Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Stockholm Jenkins Area Meetup, March 2017

133 views

Published on

Reflection on history of pipelines in Jenkins as well as current state of pipeline plugin

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Stockholm Jenkins Area Meetup, March 2017

  1. 1. Stockholm Jenkins Area Meetup Few small tips about Jenkins pipeline that could save you few hours and some WTF
  2. 2. Andrey Devyatkin Long time Continuous Delivery practitioner Impossibility remediation specialist at Praqma Open Source enthusiast @andrey9kin andrey@praqma.com
  3. 3. Early days - freestyle job and UI
  4. 4. Some improvements for visualisation https://wiki.jenkins-ci.org/display/JENKINS/Delivery+Pipeline+Plugin
  5. 5. Going wild… with Groovy
  6. 6. JobDSL
  7. 7. What is Jenkins job?
  8. 8. What is Jenkins job?
  9. 9. Wait! My plugin is not supported
  10. 10. BuildFlow
  11. 11. And here comes workflow... pipeline
  12. 12. Nested steps?
  13. 13. Pipeline basics Jenkinsfile (Declarative Pipeline) pipeline { agent any stages { stage('Build') { steps { echo 'This is a minimal pipeline.' } } } }
  14. 14. Multi SCM checkout node { git url: 'https://github.com/jglick/simple-maven-project-with-tests.git' sh "echo Build" } node { git url: 'https://github.com/jglick/some-other-simple-maven-project-with-tests.git' sh "echo Build" } git poll: true, url: 'https://github.com/jglick/some-other-simple-maven-project-with-tests.git'
  15. 15. Environment node { git url: 'https://github.com/jglick/simple-maven-project-with-tests.git' def mvnHome = tool 'M3' env.PATH = "${mvnHome}/bin:${env.PATH}" sh 'mvn -B verify' } Cool! However...
  16. 16. Stash/Unstash // Run on a node with the "first-node" label. node('first-node') { // Stash that directory and file. // Note that the includes could be "output/", "output/*" as below, or even // "output/**/*" - it all works out basically the same. stash name: "first-stash", includes: "output/*" } // Run on a node with the "second-node" label. node('second-node') { // Run the unstash from within that directory! dir("first-stash") { unstash "first-stash" } } Cool! However...
  17. 17. Pipeline shared libraries Cool! However...
  18. 18. NonCPS
  19. 19. Utility steps
  20. 20. Thanks!
  21. 21. http://www.code-conf.com
  22. 22. www.praqma.com

×