SlideShare ist ein Scribd-Unternehmen logo
1 von 21
Downloaden Sie, um offline zu lesen
Administering Jenkins
Soumyak Bhattacharyya
Product Developer
DevOps Enthusiast
Simple ideas are easier to understand. Ideas that are
easier to understand are repeated. Ideas that are
repeated change the world.
Agenda
• Installation
• Backup / Restore
• Monitoring
• CLI
• API
Installation
1. Options
1. WAR file
2. Docker
3. OS Specific
1. Ubuntu
2. CentOS
3. Windows
Docker Based Installation
• DEMO
Backup & Restore
… lets take a step back & understand $WORKSPACE first
Workspace
• Disposable file based storage for Jenkins engine
• Can be pointed by $JENKINS_HOME initialization parameters
• Major components
• init.groovy.d – scripts placed here are executed at start up
• plugins – directory to host .jpi files (formally known as .hpi files)
• hudson.model.UpdateCenter.xml – where to look for plugins / updates
• nodes – to keep metadata about slaves
• userContent – treat it as http host for user files
• jobs – for job information, consists of build directories
• logs – log of Jenkins
• secrets, users, updates …
Typical Job Workspace
Plugins POV
• https://wiki.jenkins.io/display/JENKINS/Backup+Plugin
• Manual
• Backs up full Jenkins home !!!
• Requires large storage space
• https://wiki.jenkins.io/display/JENKINS/thinBackup
• Schedule driven
• Loads of features
• Selective exclusion supported
• https://wiki.jenkins.io/display/JENKINS/JobConfigHistory+Plugin
• Track modifications made to job configuration
• Old school
Administer … Log Rotation
1. Discard older build record judiciously
2. Artifacts produced by builds usually takes disk space
3. Keep build metadata but discard artifacts
4. Parmalink to last successful build will always be kept intact
5. For important build use
Administer … Disk Usage
1. Monitor disk usage with https://wiki.jenkins.io/display/JENKINS/CloudBees+Simple+Disk+Usage+Plugin
2. Refrain using old https://wiki.jenkins.io/display/JENKINS/Disk+Usage+Plugin
3. Be aware of the fact that Maven jobs by default archives artifacts, that are produced during builds
1. Disable auto archiving
Monitoring Jenkins
https://wiki.jenkins.io/display/JENKINS/Monitoring
CLI
Usage examples
java -jar jenkins-cli.jar -s http://localhost:8080 -auth admin:d4b018ebd020677d95fe5e8c2c016911Login
List Available Commands java -jar jenkins-cli.jar -s http://localhost:8080 help
Get Help On Specific Command java -jar jenkins-cli.jar -s http://localhost:8080 help list-jobs
HTTP API
1. HTTP API available as part of major resource definition
1. …/resource_name/api
2. Media Type : Get response as XML / JSON
3. Filter : Filter response using XPath / Tree
4. Volume : “depth” factor controlling amount of data being received
5. Resources
1. Overall
2. Job
3. Queue
4. Build
5. Load
6. Management operations can not be done over HTTP API
HTTP API Invocation
• Jenkins by default has CSRF Protection enabled which prevents one-
click attacks. This mandates you using Crumb while invoking API
• From 2.0 onward
• However you will require to enable this in any earlier version
Step 1 : Get Crumb for yourself
Step 2a : Build a job
wget -q --auth-no-challenge --user admin --password admin --output-document -
'http://localhost:8080/crumbIssuer/api/xml?xpath=concat(//crumbRequestField,":",//crumb)'
curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST
'http://admin:89dba97bd886ee392ee3acc735378ec6@localhost:8080/job/job-1/build' -H "Jenkins-
Crumb:e5a28794c8afff48509e40d21f0e383a"
HTTP API Invocation
Step 2b : Build a job with parameter
curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST
'http://admin:89dba97bd886ee392ee3acc735378ec6@localhost:8080/job/job-
2/buildWithParameters?YOUR_NAME=JenkinsFan' -H "Jenkins-Crumb:e5a28794c8afff48509e40d21f0e383a"
Useful Urls
• http://localhost:8080/about/ : get information about version & plugin
• http://localhost:8080/systemInfo : get info about properties
• http://localhost:8080/threadDump : get info about thread waiting state
Challenges : Jenkins@Enterprise
• Challenge : new plugin version breaks Jenkins (accidentally)
• Resolution : use sacrificial Jenkins instance
• Challenge : disk overflowing with artifacts
• Resolution : establish backup / restore policy & have sensible build retention policy
• Challenge : script spaghetti
• Resolution : have a policy to manage custom scripts
• Challenge : resource depletion
• Resolution : enable monitoring
• Challenge : general lack of consistency between jobs
• Resolution : introduce template job definition & keep variations limited
Q & A
Thanks !!!
@soumyak_
https://www.linkedin.com/in/soumyakbhattacharyya

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Who *is* Jenkins?
Who *is* Jenkins?Who *is* Jenkins?
Who *is* Jenkins?
 
Continuous Delivery for Front-End Engineers
Continuous Delivery for Front-End EngineersContinuous Delivery for Front-End Engineers
Continuous Delivery for Front-End Engineers
 
Automated-Testing-inside-containers
Automated-Testing-inside-containersAutomated-Testing-inside-containers
Automated-Testing-inside-containers
 
e2e testing with cypress
e2e testing with cypresse2e testing with cypress
e2e testing with cypress
 
Selenoid: browsers in containers
Selenoid: browsers in containersSelenoid: browsers in containers
Selenoid: browsers in containers
 
Automated testing with Cypress
Automated testing with CypressAutomated testing with Cypress
Automated testing with Cypress
 
QA Fest 2017. Александр Хотемской. Современные возможности в организации Prot...
QA Fest 2017. Александр Хотемской. Современные возможности в организации Prot...QA Fest 2017. Александр Хотемской. Современные возможности в организации Prot...
QA Fest 2017. Александр Хотемской. Современные возможности в организации Prot...
 
Jenkinsfileのlintで救える命がある
Jenkinsfileのlintで救える命があるJenkinsfileのlintで救える命がある
Jenkinsfileのlintで救える命がある
 
Introduction to cypress in Angular (Chinese)
Introduction to cypress in Angular (Chinese)Introduction to cypress in Angular (Chinese)
Introduction to cypress in Angular (Chinese)
 
Jenkins workflows and Best Practices
Jenkins workflows and Best PracticesJenkins workflows and Best Practices
Jenkins workflows and Best Practices
 
Welcome to Jenkins
Welcome to JenkinsWelcome to Jenkins
Welcome to Jenkins
 
Cypress - Best Practices
Cypress - Best PracticesCypress - Best Practices
Cypress - Best Practices
 
Selenium and Sauce Labs
Selenium and Sauce LabsSelenium and Sauce Labs
Selenium and Sauce Labs
 
Cypress report
Cypress reportCypress report
Cypress report
 
Jenkins Best Practices
Jenkins Best PracticesJenkins Best Practices
Jenkins Best Practices
 
Async webdriverjs
Async webdriverjsAsync webdriverjs
Async webdriverjs
 
End to end test automation with cypress
End to end test automation with cypressEnd to end test automation with cypress
End to end test automation with cypress
 
Jenkins user conference 2011
Jenkins user conference 2011Jenkins user conference 2011
Jenkins user conference 2011
 
QA Challenge Accepted 4.0 - Cypress vs. Selenium
QA Challenge Accepted 4.0 - Cypress vs. SeleniumQA Challenge Accepted 4.0 - Cypress vs. Selenium
QA Challenge Accepted 4.0 - Cypress vs. Selenium
 
Continuous Delivery - Voxxed Days Cluj-Napoca 2017
Continuous Delivery - Voxxed Days Cluj-Napoca 2017Continuous Delivery - Voxxed Days Cluj-Napoca 2017
Continuous Delivery - Voxxed Days Cluj-Napoca 2017
 

Ähnlich wie Slides 29-07-2017

Ähnlich wie Slides 29-07-2017 (20)

Intro to Pentesting Jenkins
Intro to Pentesting JenkinsIntro to Pentesting Jenkins
Intro to Pentesting Jenkins
 
Dockers zero to hero
Dockers zero to heroDockers zero to hero
Dockers zero to hero
 
Road to Opscon (Pisa '15) - DevOoops
Road to Opscon (Pisa '15) - DevOoopsRoad to Opscon (Pisa '15) - DevOoops
Road to Opscon (Pisa '15) - DevOoops
 
WTF my container just spawned a shell!
WTF my container just spawned a shell!WTF my container just spawned a shell!
WTF my container just spawned a shell!
 
Linux privesc.pptx
Linux privesc.pptxLinux privesc.pptx
Linux privesc.pptx
 
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)
 
Tutorial 1: Your First Science App - Araport Developer Workshop
Tutorial 1: Your First Science App - Araport Developer WorkshopTutorial 1: Your First Science App - Araport Developer Workshop
Tutorial 1: Your First Science App - Araport Developer Workshop
 
Grâce aux tags Varnish, j'ai switché ma prod sur Raspberry Pi
Grâce aux tags Varnish, j'ai switché ma prod sur Raspberry PiGrâce aux tags Varnish, j'ai switché ma prod sur Raspberry Pi
Grâce aux tags Varnish, j'ai switché ma prod sur Raspberry Pi
 
Automation with ansible
Automation with ansibleAutomation with ansible
Automation with ansible
 
Privilege Escalation with Metasploit
Privilege Escalation with MetasploitPrivilege Escalation with Metasploit
Privilege Escalation with Metasploit
 
NSC #2 - D3 02 - Peter Hlavaty - Attack on the Core
NSC #2 - D3 02 - Peter Hlavaty - Attack on the CoreNSC #2 - D3 02 - Peter Hlavaty - Attack on the Core
NSC #2 - D3 02 - Peter Hlavaty - Attack on the Core
 
Un jenkins amélioré avec docker mesos et marathon à Devoxx 2015
Un jenkins amélioré avec docker mesos et marathon à Devoxx 2015Un jenkins amélioré avec docker mesos et marathon à Devoxx 2015
Un jenkins amélioré avec docker mesos et marathon à Devoxx 2015
 
Intro to containerization
Intro to containerizationIntro to containerization
Intro to containerization
 
How to Combine Artifacts and Source in a Single Server
How to Combine Artifacts and Source in a Single ServerHow to Combine Artifacts and Source in a Single Server
How to Combine Artifacts and Source in a Single Server
 
DevOpsDays InSpec Workshop
DevOpsDays InSpec WorkshopDevOpsDays InSpec Workshop
DevOpsDays InSpec Workshop
 
Automated testing with Drupal
Automated testing with DrupalAutomated testing with Drupal
Automated testing with Drupal
 
Linux automated tasks
Linux automated tasksLinux automated tasks
Linux automated tasks
 
Hacking Jenkins
Hacking JenkinsHacking Jenkins
Hacking Jenkins
 
XPages -Beyond the Basics
XPages -Beyond the BasicsXPages -Beyond the Basics
XPages -Beyond the Basics
 
Go Faster with Ansible (PHP meetup)
Go Faster with Ansible (PHP meetup)Go Faster with Ansible (PHP meetup)
Go Faster with Ansible (PHP meetup)
 

Kürzlich hochgeladen

Thalassery Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call G...
Thalassery Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call G...Thalassery Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call G...
Thalassery Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call G...
Call Girls In Delhi Whatsup 9873940964 Enjoy Unlimited Pleasure
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
imonikaupta
 
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...
nilamkumrai
 
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
nirzagarg
 
📱Dehradun Call Girls Service 📱☎️ +91'905,3900,678 ☎️📱 Call Girls In Dehradun 📱
📱Dehradun Call Girls Service 📱☎️ +91'905,3900,678 ☎️📱 Call Girls In Dehradun 📱📱Dehradun Call Girls Service 📱☎️ +91'905,3900,678 ☎️📱 Call Girls In Dehradun 📱
📱Dehradun Call Girls Service 📱☎️ +91'905,3900,678 ☎️📱 Call Girls In Dehradun 📱
@Chandigarh #call #Girls 9053900678 @Call #Girls in @Punjab 9053900678
 
💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
nirzagarg
 
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
Call Girls In Delhi Whatsup 9873940964 Enjoy Unlimited Pleasure
 

Kürzlich hochgeladen (20)

Thalassery Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call G...
Thalassery Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call G...Thalassery Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call G...
Thalassery Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call G...
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
 
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
 
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
 
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...
( Pune ) VIP Baner Call Girls 🎗️ 9352988975 Sizzling | Escorts | Girls Are Re...
 
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
 
Microsoft Azure Arc Customer Deck Microsoft
Microsoft Azure Arc Customer Deck MicrosoftMicrosoft Azure Arc Customer Deck Microsoft
Microsoft Azure Arc Customer Deck Microsoft
 
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
 
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrStory Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
 
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
 
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53
 
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
 
📱Dehradun Call Girls Service 📱☎️ +91'905,3900,678 ☎️📱 Call Girls In Dehradun 📱
📱Dehradun Call Girls Service 📱☎️ +91'905,3900,678 ☎️📱 Call Girls In Dehradun 📱📱Dehradun Call Girls Service 📱☎️ +91'905,3900,678 ☎️📱 Call Girls In Dehradun 📱
📱Dehradun Call Girls Service 📱☎️ +91'905,3900,678 ☎️📱 Call Girls In Dehradun 📱
 
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort ServiceBusty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
 
💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Salem Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
 
Katraj ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For S...
Katraj ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For S...Katraj ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For S...
Katraj ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For S...
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
 
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
 
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls DubaiDubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
 

Slides 29-07-2017

  • 2.
  • 3. Simple ideas are easier to understand. Ideas that are easier to understand are repeated. Ideas that are repeated change the world.
  • 4. Agenda • Installation • Backup / Restore • Monitoring • CLI • API
  • 5. Installation 1. Options 1. WAR file 2. Docker 3. OS Specific 1. Ubuntu 2. CentOS 3. Windows
  • 7. Backup & Restore … lets take a step back & understand $WORKSPACE first
  • 8. Workspace • Disposable file based storage for Jenkins engine • Can be pointed by $JENKINS_HOME initialization parameters • Major components • init.groovy.d – scripts placed here are executed at start up • plugins – directory to host .jpi files (formally known as .hpi files) • hudson.model.UpdateCenter.xml – where to look for plugins / updates • nodes – to keep metadata about slaves • userContent – treat it as http host for user files • jobs – for job information, consists of build directories • logs – log of Jenkins • secrets, users, updates …
  • 10. Plugins POV • https://wiki.jenkins.io/display/JENKINS/Backup+Plugin • Manual • Backs up full Jenkins home !!! • Requires large storage space • https://wiki.jenkins.io/display/JENKINS/thinBackup • Schedule driven • Loads of features • Selective exclusion supported • https://wiki.jenkins.io/display/JENKINS/JobConfigHistory+Plugin • Track modifications made to job configuration • Old school
  • 11. Administer … Log Rotation 1. Discard older build record judiciously 2. Artifacts produced by builds usually takes disk space 3. Keep build metadata but discard artifacts 4. Parmalink to last successful build will always be kept intact 5. For important build use
  • 12. Administer … Disk Usage 1. Monitor disk usage with https://wiki.jenkins.io/display/JENKINS/CloudBees+Simple+Disk+Usage+Plugin 2. Refrain using old https://wiki.jenkins.io/display/JENKINS/Disk+Usage+Plugin 3. Be aware of the fact that Maven jobs by default archives artifacts, that are produced during builds 1. Disable auto archiving
  • 14. CLI Usage examples java -jar jenkins-cli.jar -s http://localhost:8080 -auth admin:d4b018ebd020677d95fe5e8c2c016911Login List Available Commands java -jar jenkins-cli.jar -s http://localhost:8080 help Get Help On Specific Command java -jar jenkins-cli.jar -s http://localhost:8080 help list-jobs
  • 15. HTTP API 1. HTTP API available as part of major resource definition 1. …/resource_name/api 2. Media Type : Get response as XML / JSON 3. Filter : Filter response using XPath / Tree 4. Volume : “depth” factor controlling amount of data being received 5. Resources 1. Overall 2. Job 3. Queue 4. Build 5. Load 6. Management operations can not be done over HTTP API
  • 16. HTTP API Invocation • Jenkins by default has CSRF Protection enabled which prevents one- click attacks. This mandates you using Crumb while invoking API • From 2.0 onward • However you will require to enable this in any earlier version Step 1 : Get Crumb for yourself Step 2a : Build a job wget -q --auth-no-challenge --user admin --password admin --output-document - 'http://localhost:8080/crumbIssuer/api/xml?xpath=concat(//crumbRequestField,":",//crumb)' curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST 'http://admin:89dba97bd886ee392ee3acc735378ec6@localhost:8080/job/job-1/build' -H "Jenkins- Crumb:e5a28794c8afff48509e40d21f0e383a"
  • 17. HTTP API Invocation Step 2b : Build a job with parameter curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST 'http://admin:89dba97bd886ee392ee3acc735378ec6@localhost:8080/job/job- 2/buildWithParameters?YOUR_NAME=JenkinsFan' -H "Jenkins-Crumb:e5a28794c8afff48509e40d21f0e383a"
  • 18. Useful Urls • http://localhost:8080/about/ : get information about version & plugin • http://localhost:8080/systemInfo : get info about properties • http://localhost:8080/threadDump : get info about thread waiting state
  • 19. Challenges : Jenkins@Enterprise • Challenge : new plugin version breaks Jenkins (accidentally) • Resolution : use sacrificial Jenkins instance • Challenge : disk overflowing with artifacts • Resolution : establish backup / restore policy & have sensible build retention policy • Challenge : script spaghetti • Resolution : have a policy to manage custom scripts • Challenge : resource depletion • Resolution : enable monitoring • Challenge : general lack of consistency between jobs • Resolution : introduce template job definition & keep variations limited
  • 20. Q & A