SlideShare a Scribd company logo
1 of 10
Download to read offline
https://www.flickr.com/photos/amerune/9294639633/in/photostream/
Jenkins Pipelines
Ramanathan Muthaiah,
rus.cahimb@gmail.com
DevOps Meetup, Bengaluru,
19/Aug/2017
What’s in it for me?
Pipeline helps to,
codify build flow
divide monolithic build
to logical stages
bind execution of one
or more stages based
on previous stage’s
result
abstract common tasks
to shared libraries
Learn Groovy DSL (scripted
syntax, shared libraries)
Declarative syntax follows
imperative model
Jenkins v2.x + Pipeline suite
of plugins
Tons and tons of patience to
toil, sweat a.k.a. R(ead),
A(pply), D(ocument) and
S(hare)
lots and lots of
Pre-requisites
https://www.flickr.com/photos/87232391@N00/403119696
Getting Started. . .
Have a test Jenkins master,
playground for trial and error
mirror (as close as possible) production instance
access to rest of infra or replicate where infra cannot be shared (e.g:
artifactory, s3, build agents)
mental model of what to do — logical blocks needed, how to tie them
up, what can or cannot be done in parallel, archive, notifications.
Tooo……ooons of material on the Internet on Jenkins Pipeline
Bite the bullet . . . Start writing pipeline as code
Start with individual stages, one stage at a time
Pipeline syntax and snippet generator
Pipeline script in <Version Control> => modify, build, test : repeat
Better yet, Replay on the passed or failed job
update on the fly, build, test
But, but, no Replay for builds failed on Groovy syntax :-(
Namaskara…
#!groovy
node(‘linux’) { // any build agent with label, linux;if left blank, master
stage(‘Prep’) {
def greet = “Welcome to Pipeline” // variable declaration
echo “${greet}”
sh “uname -a”
def ip_address = sh(returnStdout: true, 
script: “ifconfig eth0 | grep -i inet | head -1 | awk -F’:’ ‘{print $2}’
| awk -F’ ‘ ‘{print $1}’”).trim()
println “Node’s IP address, ip_address”
}
}
Common Gotchas…
Pipeline syntax errors
DO NOT copy and paste from your editor or from the previous slide
Most common: Typos in pipeline code
Cautious with usage of Unix tools within Pipeline
single, double quotes
Got it finally…
#!groovy
node(‘linux’) { // build agent with label ‘linux’;if left blank,
master
stage("Prep") {
def greet = “Welcome to Pipeline" // variable declaration
echo "${greet}"
sh "uname -a"
sh "'/sbin/ifconfig eth0 | 
grep -i inet | head -1 | 
cut -d: -f2 |
awk -F' ' '{print $1}' 
"'
}
sh step has many avatars
1. sh “command”
2. sh (returnStdout …)
3. sh (returnStatus …)
4. sh followed by three single or double quotes
(for variable interpolation)
Output from build console log
useful links
Online examples for various steps…
wiki => https://jenkins.io/doc/pipeline/examples/
code => https://github.com/jenkinsci/pipeline-examples/tree/master/
pipeline-examples
contribute your’s today, https://github.com/jenkinsci/pipeline-examples
Plugins compatible with Pipeline
https://github.com/jenkinsci/pipeline-plugin/blob/master/COMPATIBILITY.md
Pipeline resources
Syntax reference, https://jenkins.io/doc/book/pipeline/syntax
Steps reference, https://jenkins.io/doc/pipeline/steps
BlueOcean
https://jenkins.io/doc/book/blueocean
Handling SCM … Git
Have generic service accounts, avoid storing user credentials
Jenkins has built-in implementation of Git :-)
But, it may not be in sync with generally available version of Git :-(
Handling large Git repos in Jenkins
First 10mins from Jenkins online meetup video, https://www.youtube.com/
watch?v=TsWkZLLU-s4
https://www.cloudbees.com/blog/advanced-git-jenkins
General tips for handling large Git repos,
https://www.atlassian.com/blog/git/handle-big-repositories-git
https://larsxschneider.github.io/2016/09/21/large-git-repos

More Related Content

What's hot

DevOps Fest 2020. Роман Орлов. Инфраструктура тестирования в Kubernetes
DevOps Fest 2020. Роман Орлов. Инфраструктура тестирования в KubernetesDevOps Fest 2020. Роман Орлов. Инфраструктура тестирования в Kubernetes
DevOps Fest 2020. Роман Орлов. Инфраструктура тестирования в KubernetesDevOps_Fest
 
@arzumy Dev Setup #klxrb
@arzumy Dev Setup #klxrb@arzumy Dev Setup #klxrb
@arzumy Dev Setup #klxrbArzumy MD
 
JavaScript and Desktop Apps - Introduction to Electron
JavaScript and Desktop Apps - Introduction to ElectronJavaScript and Desktop Apps - Introduction to Electron
JavaScript and Desktop Apps - Introduction to ElectronBrainhub
 
Learned lessons in a real world project
Learned lessons in a real world projectLearned lessons in a real world project
Learned lessons in a real world projectCodium
 
Session on Selenium 4 : What’s coming our way? by Hitesh Prajapati
Session on Selenium 4 : What’s coming our way? by Hitesh PrajapatiSession on Selenium 4 : What’s coming our way? by Hitesh Prajapati
Session on Selenium 4 : What’s coming our way? by Hitesh PrajapatiAgile Testing Alliance
 
Deliver Python Apps with Docker
Deliver Python Apps with DockerDeliver Python Apps with Docker
Deliver Python Apps with DockerAnton Egorov
 
2. auto deploy to tomcat on jenkins
2. auto deploy to tomcat on jenkins2. auto deploy to tomcat on jenkins
2. auto deploy to tomcat on jenkinsHuang Bruce
 
WordPress workflow of the future
WordPress workflow of the futureWordPress workflow of the future
WordPress workflow of the futureEli McMakin
 
Jenkins on Docker
Jenkins on DockerJenkins on Docker
Jenkins on DockerCraig Trim
 
XebiCon'16 : Fastlane : Automatisez votre vie (de développeur iOS) Par Jean-...
XebiCon'16 : Fastlane : Automatisez votre vie (de développeur iOS)  Par Jean-...XebiCon'16 : Fastlane : Automatisez votre vie (de développeur iOS)  Par Jean-...
XebiCon'16 : Fastlane : Automatisez votre vie (de développeur iOS) Par Jean-...Publicis Sapient Engineering
 
Session on Launching Selenium Grid and Running tests using docker compose and...
Session on Launching Selenium Grid and Running tests using docker compose and...Session on Launching Selenium Grid and Running tests using docker compose and...
Session on Launching Selenium Grid and Running tests using docker compose and...Agile Testing Alliance
 
Introduction to Eclipse Che - Devoxx FR - 2017
Introduction to Eclipse Che - Devoxx FR - 2017Introduction to Eclipse Che - Devoxx FR - 2017
Introduction to Eclipse Che - Devoxx FR - 2017stevanLM
 
How to convince a malware to avoid us
How to convince a malware to avoid usHow to convince a malware to avoid us
How to convince a malware to avoid usCsaba Fitzl
 
CodeIgniter Lab
CodeIgniter LabCodeIgniter Lab
CodeIgniter LabLeo Nguyen
 
Building an in house support team
Building an in house support teamBuilding an in house support team
Building an in house support teamPascal Rapicault
 
PHP Dependency Management with Composer
PHP Dependency Management with ComposerPHP Dependency Management with Composer
PHP Dependency Management with ComposerAdam Englander
 
Composer for Busy Developers - php|tek13
Composer for Busy Developers - php|tek13Composer for Busy Developers - php|tek13
Composer for Busy Developers - php|tek13Rafael Dohms
 
Lightweight development (Lightning talk)
Lightweight development (Lightning talk)Lightweight development (Lightning talk)
Lightweight development (Lightning talk)zroger
 

What's hot (20)

DevOps Fest 2020. Роман Орлов. Инфраструктура тестирования в Kubernetes
DevOps Fest 2020. Роман Орлов. Инфраструктура тестирования в KubernetesDevOps Fest 2020. Роман Орлов. Инфраструктура тестирования в Kubernetes
DevOps Fest 2020. Роман Орлов. Инфраструктура тестирования в Kubernetes
 
@arzumy Dev Setup #klxrb
@arzumy Dev Setup #klxrb@arzumy Dev Setup #klxrb
@arzumy Dev Setup #klxrb
 
JavaScript and Desktop Apps - Introduction to Electron
JavaScript and Desktop Apps - Introduction to ElectronJavaScript and Desktop Apps - Introduction to Electron
JavaScript and Desktop Apps - Introduction to Electron
 
Learned lessons in a real world project
Learned lessons in a real world projectLearned lessons in a real world project
Learned lessons in a real world project
 
Jenkins auto configureforbranch-php
Jenkins auto configureforbranch-phpJenkins auto configureforbranch-php
Jenkins auto configureforbranch-php
 
Docker
DockerDocker
Docker
 
Session on Selenium 4 : What’s coming our way? by Hitesh Prajapati
Session on Selenium 4 : What’s coming our way? by Hitesh PrajapatiSession on Selenium 4 : What’s coming our way? by Hitesh Prajapati
Session on Selenium 4 : What’s coming our way? by Hitesh Prajapati
 
Deliver Python Apps with Docker
Deliver Python Apps with DockerDeliver Python Apps with Docker
Deliver Python Apps with Docker
 
2. auto deploy to tomcat on jenkins
2. auto deploy to tomcat on jenkins2. auto deploy to tomcat on jenkins
2. auto deploy to tomcat on jenkins
 
WordPress workflow of the future
WordPress workflow of the futureWordPress workflow of the future
WordPress workflow of the future
 
Jenkins on Docker
Jenkins on DockerJenkins on Docker
Jenkins on Docker
 
XebiCon'16 : Fastlane : Automatisez votre vie (de développeur iOS) Par Jean-...
XebiCon'16 : Fastlane : Automatisez votre vie (de développeur iOS)  Par Jean-...XebiCon'16 : Fastlane : Automatisez votre vie (de développeur iOS)  Par Jean-...
XebiCon'16 : Fastlane : Automatisez votre vie (de développeur iOS) Par Jean-...
 
Session on Launching Selenium Grid and Running tests using docker compose and...
Session on Launching Selenium Grid and Running tests using docker compose and...Session on Launching Selenium Grid and Running tests using docker compose and...
Session on Launching Selenium Grid and Running tests using docker compose and...
 
Introduction to Eclipse Che - Devoxx FR - 2017
Introduction to Eclipse Che - Devoxx FR - 2017Introduction to Eclipse Che - Devoxx FR - 2017
Introduction to Eclipse Che - Devoxx FR - 2017
 
How to convince a malware to avoid us
How to convince a malware to avoid usHow to convince a malware to avoid us
How to convince a malware to avoid us
 
CodeIgniter Lab
CodeIgniter LabCodeIgniter Lab
CodeIgniter Lab
 
Building an in house support team
Building an in house support teamBuilding an in house support team
Building an in house support team
 
PHP Dependency Management with Composer
PHP Dependency Management with ComposerPHP Dependency Management with Composer
PHP Dependency Management with Composer
 
Composer for Busy Developers - php|tek13
Composer for Busy Developers - php|tek13Composer for Busy Developers - php|tek13
Composer for Busy Developers - php|tek13
 
Lightweight development (Lightning talk)
Lightweight development (Lightning talk)Lightweight development (Lightning talk)
Lightweight development (Lightning talk)
 

Similar to Jenkins Pipelines for Continuous Delivery

The Unbearable Lightness: Extending the Bash shell
The Unbearable Lightness: Extending the Bash shellThe Unbearable Lightness: Extending the Bash shell
The Unbearable Lightness: Extending the Bash shellRoberto Reale
 
NYPHP March 2009 Presentation
NYPHP March 2009 PresentationNYPHP March 2009 Presentation
NYPHP March 2009 Presentationbrian_dailey
 
510Lec01-Overview.pptx
510Lec01-Overview.pptx510Lec01-Overview.pptx
510Lec01-Overview.pptxKrosumLabs1
 
(1) cpp introducing the_cpp_programming_language
(1) cpp introducing the_cpp_programming_language(1) cpp introducing the_cpp_programming_language
(1) cpp introducing the_cpp_programming_languageNico Ludwig
 
Easy deployment & management of cloud apps
Easy deployment & management of cloud appsEasy deployment & management of cloud apps
Easy deployment & management of cloud appsDavid Cunningham
 
Introduction to PowerShell
Introduction to PowerShellIntroduction to PowerShell
Introduction to PowerShellBoulos Dib
 
Functional Programming with Streams in node.js
Functional Programming with Streams in node.jsFunctional Programming with Streams in node.js
Functional Programming with Streams in node.jsAdam Crabtree
 
Developing IT infrastructures with Puppet
Developing IT infrastructures with PuppetDeveloping IT infrastructures with Puppet
Developing IT infrastructures with PuppetAlessandro Franceschi
 
Sinatra: прошлое, будущее и настоящее
Sinatra: прошлое, будущее и настоящееSinatra: прошлое, будущее и настоящее
Sinatra: прошлое, будущее и настоящее.toster
 
BUILDING APPS WITH ASYNCIO
BUILDING APPS WITH ASYNCIOBUILDING APPS WITH ASYNCIO
BUILDING APPS WITH ASYNCIOMykola Novik
 
Python for Linux System Administration
Python for Linux System AdministrationPython for Linux System Administration
Python for Linux System Administrationvceder
 
Shell scripting - By Vu Duy Tu from eXo Platform SEA
Shell scripting - By Vu Duy Tu from eXo Platform SEAShell scripting - By Vu Duy Tu from eXo Platform SEA
Shell scripting - By Vu Duy Tu from eXo Platform SEAThuy_Dang
 
Slackware Demystified [SELF 2011]
Slackware Demystified [SELF 2011]Slackware Demystified [SELF 2011]
Slackware Demystified [SELF 2011]Vincent Batts
 
Bash is not a second zone citizen programming language
Bash is not a second zone citizen programming languageBash is not a second zone citizen programming language
Bash is not a second zone citizen programming languageRené Ribaud
 
Container (Docker) Orchestration Tools
Container (Docker) Orchestration ToolsContainer (Docker) Orchestration Tools
Container (Docker) Orchestration ToolsDhilipsiva DS
 
Porting your favourite cmdline tool to Android
Porting your favourite cmdline tool to AndroidPorting your favourite cmdline tool to Android
Porting your favourite cmdline tool to AndroidVlatko Kosturjak
 
Program Assignment Process ManagementObjective This program a.docx
Program Assignment  Process ManagementObjective This program a.docxProgram Assignment  Process ManagementObjective This program a.docx
Program Assignment Process ManagementObjective This program a.docxwkyra78
 
The GO Language : From Beginners to Gophers
The GO Language : From Beginners to GophersThe GO Language : From Beginners to Gophers
The GO Language : From Beginners to GophersAlessandro Sanino
 
A Recovering Java Developer Learns to Go
A Recovering Java Developer Learns to GoA Recovering Java Developer Learns to Go
A Recovering Java Developer Learns to GoMatt Stine
 

Similar to Jenkins Pipelines for Continuous Delivery (20)

The Unbearable Lightness: Extending the Bash shell
The Unbearable Lightness: Extending the Bash shellThe Unbearable Lightness: Extending the Bash shell
The Unbearable Lightness: Extending the Bash shell
 
NYPHP March 2009 Presentation
NYPHP March 2009 PresentationNYPHP March 2009 Presentation
NYPHP March 2009 Presentation
 
510Lec01-Overview.pptx
510Lec01-Overview.pptx510Lec01-Overview.pptx
510Lec01-Overview.pptx
 
(1) cpp introducing the_cpp_programming_language
(1) cpp introducing the_cpp_programming_language(1) cpp introducing the_cpp_programming_language
(1) cpp introducing the_cpp_programming_language
 
Easy deployment & management of cloud apps
Easy deployment & management of cloud appsEasy deployment & management of cloud apps
Easy deployment & management of cloud apps
 
Introduction to PowerShell
Introduction to PowerShellIntroduction to PowerShell
Introduction to PowerShell
 
Functional Programming with Streams in node.js
Functional Programming with Streams in node.jsFunctional Programming with Streams in node.js
Functional Programming with Streams in node.js
 
Developing IT infrastructures with Puppet
Developing IT infrastructures with PuppetDeveloping IT infrastructures with Puppet
Developing IT infrastructures with Puppet
 
Sinatra: прошлое, будущее и настоящее
Sinatra: прошлое, будущее и настоящееSinatra: прошлое, будущее и настоящее
Sinatra: прошлое, будущее и настоящее
 
PyCon 2011: IronPython Command Line
PyCon 2011:  IronPython Command LinePyCon 2011:  IronPython Command Line
PyCon 2011: IronPython Command Line
 
BUILDING APPS WITH ASYNCIO
BUILDING APPS WITH ASYNCIOBUILDING APPS WITH ASYNCIO
BUILDING APPS WITH ASYNCIO
 
Python for Linux System Administration
Python for Linux System AdministrationPython for Linux System Administration
Python for Linux System Administration
 
Shell scripting - By Vu Duy Tu from eXo Platform SEA
Shell scripting - By Vu Duy Tu from eXo Platform SEAShell scripting - By Vu Duy Tu from eXo Platform SEA
Shell scripting - By Vu Duy Tu from eXo Platform SEA
 
Slackware Demystified [SELF 2011]
Slackware Demystified [SELF 2011]Slackware Demystified [SELF 2011]
Slackware Demystified [SELF 2011]
 
Bash is not a second zone citizen programming language
Bash is not a second zone citizen programming languageBash is not a second zone citizen programming language
Bash is not a second zone citizen programming language
 
Container (Docker) Orchestration Tools
Container (Docker) Orchestration ToolsContainer (Docker) Orchestration Tools
Container (Docker) Orchestration Tools
 
Porting your favourite cmdline tool to Android
Porting your favourite cmdline tool to AndroidPorting your favourite cmdline tool to Android
Porting your favourite cmdline tool to Android
 
Program Assignment Process ManagementObjective This program a.docx
Program Assignment  Process ManagementObjective This program a.docxProgram Assignment  Process ManagementObjective This program a.docx
Program Assignment Process ManagementObjective This program a.docx
 
The GO Language : From Beginners to Gophers
The GO Language : From Beginners to GophersThe GO Language : From Beginners to Gophers
The GO Language : From Beginners to Gophers
 
A Recovering Java Developer Learns to Go
A Recovering Java Developer Learns to GoA Recovering Java Developer Learns to Go
A Recovering Java Developer Learns to Go
 

Recently uploaded

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 

Recently uploaded (20)

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 

Jenkins Pipelines for Continuous Delivery

  • 3. What’s in it for me? Pipeline helps to, codify build flow divide monolithic build to logical stages bind execution of one or more stages based on previous stage’s result abstract common tasks to shared libraries Learn Groovy DSL (scripted syntax, shared libraries) Declarative syntax follows imperative model Jenkins v2.x + Pipeline suite of plugins Tons and tons of patience to toil, sweat a.k.a. R(ead), A(pply), D(ocument) and S(hare) lots and lots of Pre-requisites https://www.flickr.com/photos/87232391@N00/403119696
  • 4. Getting Started. . . Have a test Jenkins master, playground for trial and error mirror (as close as possible) production instance access to rest of infra or replicate where infra cannot be shared (e.g: artifactory, s3, build agents) mental model of what to do — logical blocks needed, how to tie them up, what can or cannot be done in parallel, archive, notifications. Tooo……ooons of material on the Internet on Jenkins Pipeline
  • 5. Bite the bullet . . . Start writing pipeline as code Start with individual stages, one stage at a time Pipeline syntax and snippet generator Pipeline script in <Version Control> => modify, build, test : repeat Better yet, Replay on the passed or failed job update on the fly, build, test But, but, no Replay for builds failed on Groovy syntax :-(
  • 6. Namaskara… #!groovy node(‘linux’) { // any build agent with label, linux;if left blank, master stage(‘Prep’) { def greet = “Welcome to Pipeline” // variable declaration echo “${greet}” sh “uname -a” def ip_address = sh(returnStdout: true, script: “ifconfig eth0 | grep -i inet | head -1 | awk -F’:’ ‘{print $2}’ | awk -F’ ‘ ‘{print $1}’”).trim() println “Node’s IP address, ip_address” } }
  • 7. Common Gotchas… Pipeline syntax errors DO NOT copy and paste from your editor or from the previous slide Most common: Typos in pipeline code Cautious with usage of Unix tools within Pipeline single, double quotes
  • 8. Got it finally… #!groovy node(‘linux’) { // build agent with label ‘linux’;if left blank, master stage("Prep") { def greet = “Welcome to Pipeline" // variable declaration echo "${greet}" sh "uname -a" sh "'/sbin/ifconfig eth0 | grep -i inet | head -1 | cut -d: -f2 | awk -F' ' '{print $1}' "' } sh step has many avatars 1. sh “command” 2. sh (returnStdout …) 3. sh (returnStatus …) 4. sh followed by three single or double quotes (for variable interpolation) Output from build console log
  • 9. useful links Online examples for various steps… wiki => https://jenkins.io/doc/pipeline/examples/ code => https://github.com/jenkinsci/pipeline-examples/tree/master/ pipeline-examples contribute your’s today, https://github.com/jenkinsci/pipeline-examples Plugins compatible with Pipeline https://github.com/jenkinsci/pipeline-plugin/blob/master/COMPATIBILITY.md Pipeline resources Syntax reference, https://jenkins.io/doc/book/pipeline/syntax Steps reference, https://jenkins.io/doc/pipeline/steps BlueOcean https://jenkins.io/doc/book/blueocean
  • 10. Handling SCM … Git Have generic service accounts, avoid storing user credentials Jenkins has built-in implementation of Git :-) But, it may not be in sync with generally available version of Git :-( Handling large Git repos in Jenkins First 10mins from Jenkins online meetup video, https://www.youtube.com/ watch?v=TsWkZLLU-s4 https://www.cloudbees.com/blog/advanced-git-jenkins General tips for handling large Git repos, https://www.atlassian.com/blog/git/handle-big-repositories-git https://larsxschneider.github.io/2016/09/21/large-git-repos