Posts

Showing posts with the label jenkins

Digital Marketing

How to set up Jenkins to access your remote Git repository

Put repository url for example git@github.com:goyun.info/AmazonSESExampleByJavaMail.git as your Git  repository url. Then you need to add your Jenkins public ssh key to your Git repository server. You could make it read only. You also need to add your Git repository server for example git.goyun.info to your Jenkins account's known_hosts file.

How to activate SSL/HTTPS on Jenkins

For CentOS or RPM based: Go to /etc/sysconfig/jenkins, set the JENKINS_HTTP S _PORT="8443" Then restart Jenkins. If you want to generate ssh key: openssl genrsa -out key.pem  # creates key.pem openssl req -new -key key.pem -out csr.pem # you need to put the dns name of your website, testweb.local # for the 'Common Name' question # other questions, you can just accept defaults # actually, you can accept defaults for all, will work ok too openssl x509 -req -days 9999 -in csr.pem -signkey key.pem -out cert.pem rm csr.pem start jenkins if you want both https and http: java -jar jenkins.war --httpsPort=8443 --httpsCertificate=cert.pem --httpsPrivateKey=key.pem if you want https only, dont open http port: java -jar jenkins.war --httpsPort=8443 --httpsCertificate=cert.pem --httpsPrivateKey=key.pem --httpPort=-1 starting a slave Convert the cert.pem to cert.der:  openssl x509 -outform der -in cert.pem -out cert.der create keystore, containing this cert: keytool -import -alia...

How to fix Jenkins Unable to read /var/lib/jenkins/config.xml after upgrading

Stop jenkins service $ sudo service jenkins stop Move JENKINS_HOME/config.xml to another file for backup $ sudo mv /var/lib/jenkins/config.xml /var/lib/jenkins/config.xml.bak Start jenkins service $ sudo service jenkins start

Docker Jenkins initial admin password

Jenkins initial setup is required. An admin user has been created and a password generated. Docker Jenkins initial admin password can be found at: /var/jenkins_home/secrets/initialAdminPassword For docker pull jenkins/jenkins

How to remove a user from Jenkins

Just remove the user from the people table sometimes is not enough. You need to remove or replace the user from, all the times they exist, in the build.xml file(s) which are under the jobs directory then the name of the job and the builds directory. You can see what jobs the user is in from web console. Or in the backend: $ grep -wnir "i88ca" . ./users/zohaibfarooqi/config.xml:3: i88ca ./users/zohaibfarooqi/config.xml:35: i88ca@192.168.10.130 ./jobs/compile-marketing/builds/13/build.xml:63: i88ca ./jobs/compile-marketing/builds/13/changelog.xml:4:author i88ca 2018-04-04 16:59:12 -0400 ./jobs/compile-marketing/builds/13/changelog.xml:5:committer i88ca 2018-04-04 16:59:12 -0400

Jenkins on AWS

Jenkins on AWS (whitepaper): https://d0.awsstatic.com/whitepapers/DevOps/Jenkins_on_AWS.pdf • DevOps and AWS: https://aws.amazon.com/devops/ 1 https://docs.aws.amazon.com/gettingstarted/latest/wah-linux/gettingstarted-prereq.html 2 https://console.aws.amazon.com/ec2/ 3 http://checkip.amazonaws.com 4 http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-networksecurity.html 5 https://docs.aws.amazon.com/gettingstarted/latest/wah-linux/gettingstarted-prereq.html#create-a-key-pair

How to get Jenkins password

To reset the jenkins admin password, You can simply disable the security in the config.xml file. 1. If your jenkins is running on the Linux OS, edit the below file. vi /var/lib/jenkins/config.xml file. 2. Search for the word true and change the word true to false. 3. Restart the Jenkins server. service jenkins restart 4. Now go to the Jenkins portal again and Jenkins will not ask any credentials this time. You navigate to "Manage Jenkins" to set the administrator password again. 5. Enable the security again by changing settings to true and restart the Jenkins again. If your jenkins is running on Windows OS, config.xml file located in C:\Program Files (x86)\Jenkis\ folder.

Change Jenkins time zone

Image
If running Jenkins via a system package, this can be accomplished by setting JAVA_ARGS in your /etc/default/jenkins (Debian) JAVA_ARGS="-Dorg.apache.commons.jelly.tags.fmt.timeZone=America/New_York" or /etc/sysconfig/jenkins (Red Hat) such as: JENKINS_JAVA_OPTIONS="-Dorg.apache.commons.jelly.tags.fmt.timeZone=America/New_York" or, if that doesn't work, JENKINS_JAVA_OPTIONS="-Duser.timezone=America/New_York"