New version page


Upgrade to remove ads
Upgrade to remove ads
Unformatted text preview:

JenkinsAgenda:1. Installing Jenkins, setting up, configuration2. Security LDAP - authorization 3. How to schedule a job 4. integration: Integration with GIT/GITHUBIntegration with AntIntegration with MavenIntegration with AnsibleIntegration with Nexus5.Troubleshooting (location of log files of startup, failed plugin and etc)6. how to schedule backups 7. restore from backups 8. Configure Slaves 9. Monitoring the workload 10. Managing pluginsWhat is Jenkins:Leading open source continuous Integration serverHighly configurable system by itself400+ community developed pluginsMulti platform Easy to use Free & Open source Jenkins provides continuous Integration services for software deployment.- Based on tomcat- Originally started as Hudson then renamed as Jenkins - leading open source continuous integration server. - Flexibility - Jenkins is a highly configurable system by itself.- 400+ community developed plugins- Less Effort to Integrate existing existing test buckets.- Multi platform- Easy to use- Free & Open Source- Documentation: is Ok, but we need to fail fast Catching a bug in test costs less than catching in productionCode quality review Proper documentation This can be done using custom scripts, but as the project increases it is difficult to maintain.There was split in Hudson when oracle took over SUN, 90% Hudson and Jenkins are same Build can be started byCommit a version in version control Scheduling via cron like mechanism Tests can be executed every week/hour etc If A fails do B, if A passes do C – jobs can be dependent like a pipelineWhat is a build:Build has many components – one of them is version control No matters how many times a code changes, build has to happen, code has to be compiled. Build also has to be tested Communicate the results to all stake holders- Product owner- System admin- QA- DeveloperHistory – can be maintainedContinuous delivery vs Continuous deployment Continuous Deployment: deploying the product to customers continuously without approval, this is automaticContinuous delivery: approval is needed, ready to deploy. This is not automaticTest cases have to be automated for Continuous Integration Download Jenkins:Download LTS – long term support , not weekly build which is not safeDownload native packages not war packagesJenkins rpm comes with webserver Download Stable Jenkins rpm from Install it using rpm –ivh [email protected] MISC]# rpm -ivh jenkins-2.9-1.1.noarch.rpmwarning: jenkins-2.9-1.1.noarch.rpm: Header V4 DSA/SHA1 Signature, key ID d50582e6: NOKEYPreparing... ################################# [100%]Updating / installing... 1:jenkins-2.9-1.1 ################################# [100%]2. Install Java using yum 3. Start the Jenkins service [[email protected] MISC]# sudo systemctl start jenkins.service[[email protected] MISC]# cat /var/lib/jenkins/secrets/initialAdminPassworda45c1a99da7c49518ce07b7db91950e4[[email protected] MISC]#firewall-cmd --permanent --zone=public --add-port=8080/tcpto open port 8080 on Jenkins server Jenkins by default listens on port 8080So open http://FQDN:8080To change port /etc/sysconfig/jenkinshttp port to 8089 jenkins home /var/lib/jenkins/config.xmlHow to install sudo yum -y install java java is a prerequisite for Jenkins.yum whatprovides servicesudo wget -O /etc/yum.repos.d/jenkins.repo Downloads the repo file from Jenkins sitesudo rpm --import Imports the key from Jenkins site for authenticationsudo yum install jenkins- Downloads and installs the Jenkins packages from Jenkins repositorysudo systemctl status jenkins.service- Start the service and check the status – it should be ActiveDownload Jenkins Install itConfigure pluginsInstall all of them Install GIT related them Installing all may slow down Jenkins Its not recommended to enable auto refresh URL/restart  will restart JenkinsManage Jenkins  Configure global security  click on enable security Authorization  any one can do any thing Security realm Jenkins own user databaseLDAP is for corporate security to sign up using intranet id Manage Jenkins  project based authority  enable everything for admin enable all permissionsSetup security Click on Enable securityDifference between save and applyApply will remain in the same, save will go back to previous page Manage Jenkins -> configure system No. of executors – no. of core you have on CPU GIT hub server - create user id in git hub server Add git hub server Go to client Git clone back from SVN Add a file hereGit add * Git commit –m “some commit”Jenkins was developed by Kohsuke Kawaguchi.Backup of Jenkins:1. Take backup of home directory using tar -cvf commandtar -cvf jenkins-backup-21dec.tar Jenkinsgzip jenkins-backup-21dec.tarthen copy it to other machineIncase of crash, extract this file in newly created Jenkins server 2. Take backup of single job using xml a job with config.xml extension and take backup in a file.After installation: [[email protected] ~]# cat /var/lib/jenkins/secrets/initialAdminPassword1b5561f487c14ea3b9c6c386eca33cfcConfiguring Slaves:GIT Git is becoming popular in Devops worldGit is to keep track of changes Ansible/puppet/chef/vagrant – files we store on GITHUB Why GIT :1. Build & Release - devops eng works with developers2. For storing automation scripts 3. Open source - so many open source projects are hosted on GIT (Linux, chef, puppet etc)System admins take backup by copying.Cp file file_1Cp file_1 file_2 Its difficult to track Or we can name with date That is also difficult to trackIf there are many scripts – how to handle ?There should be a centralized location to keep track of all changes – that is called version control system Don’t keep track Save numbered zip fileFomal version control Diff , windiff – can see the difference Even that is difficult Developed by Linux torwalds – keep track of source code Used for just for source code Do not use for file storage Its fast Don’t need access to server Good at merging simultaneous changes Everyone is using itBitbucket is alternative GIT HUB – to store our scripts Singup to github Just give username and password Login to it Create new repository

View Full Document
Download Jenkins
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...

Join to view Jenkins and access 3M+ class-specific study document.

We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Jenkins 2 2 and access 3M+ class-specific study document.


By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?