Jenkins Best Practices Meetup Slides

Post on 07-Jan-2017

191 views 2 download

Transcript of Jenkins Best Practices Meetup Slides

Jenkins Best PracticesBy Gergely Brautigam

Links

• Github: https://github.com/Skarlso/jenkinsbestpractices

• Docker Hub: https://hub.docker.com/r/skarlso/jenkinsbestpractices/

Basics — UIhttps://wiki.jenkins-ci.org/display/JENKINS/Simple+Theme+Plugin

Before Simple Theme Plugin

http://www.metecs.com/assets/images/capabilities/jenkins-screenshot.png

After Simple Theme Plugin + Material Theme

http://jenkins-contrib-themes.github.io/jenkins-material-theme/images/screenshot-jenkins-theme-material-main-large.png

Basics - Config Histroyhttps://wiki.jenkins-ci.org/display/JENKINS/JobConfigHistory+Plugin

Diff for your config

Basics - Rebuildhttps://wiki.jenkins-ci.org/display/JENKINS/Rebuild+Plugin

Rebuild Your Previous Job

Basics - Mask Passwordhttps://wiki.jenkins-ci.org/display/JENKINS/Mask+Passwords+Plugin

No more leak in the Logs

Advanced - Foldershttps://wiki.jenkins-ci.org/display/JENKINS/CloudBees+Folders+Plugin

Folders For Branching

Usages For Folders

• Orignizing

• Clean workspace and environment

• All views is not cluttered — while with views it still is

• Branches — combined with the next one…

Advanced — DSLhttps://wiki.jenkins-ci.org/display/JENKINS/Job+DSL+Plugin

Never use the configuration screen again

Single Seed Job To Rule Them All

Branching with DSL + Folders• Job’s groovy file lives next to the source code

Advanced - MultiJobhttps://wiki.jenkins-ci.org/display/JENKINS/Multijob+Plugin

Parallel Test Runs With Multijob

Expert - Pretested Integration

https://wiki.jenkins-ci.org/display/JENKINS/Pretested+Integration+Plugin

Branch Setup

Pretest Setup

Push local branch to ready branch

• git push origin BFG-321:ready/BFG-321

Expert - Pipelines + Jenkins 2.0

• Everything you saw here — integrated

• Pipeline — Previously known as workflow

Pipeline - Jenkinsfile

Pipeline

Pipelines - MultiBranch Fetch configuration

Pipelines - MultiBranch - Run builds

Only builds branches which have ‘Jenkinsfile’ at root

Bonus Round

• Packer / Vagrant / Docker provisioning of build slaves

• Configuration management for credentials

• Load Balancing Jenkins slaves

Thank you for listening!

• Github: https://github.com/Skarlso/jenkinsbestpractices

• Docker Hub: https://hub.docker.com/r/skarlso/jenkinsbestpractices/