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.

The state of Jenkins pipelines or do I still need freestyle jobs

174 views

Published on

Day of Jenkins CPH 2018

Published in: Software
  • Be the first to comment

  • Be the first to like this

The state of Jenkins pipelines or do I still need freestyle jobs

  1. 1. The state of Jenkins pipelines or do I still need freestyle jobs? Day of Jenkins 2018 Andrey Devyatkin
  2. 2. Andrey Devyatkin ● Enjoying life ● Long time Jenkins hacker ● CI/CD enthusiast ● Writer of tools ● Fixer of things and projects ● Independent consultant
  3. 3. This talk is not… or at least trying not to be
  4. 4. Back in the days (2005) ...
  5. 5. As alternative to...
  6. 6. But first some scenarios...
  7. 7. Cron job
  8. 8. Daily build
  9. 9. Downstream ….
  10. 10. Event driven Commit ….
  11. 11. Fan-out, fan-in Commit ….
  12. 12. Fan-out, fan-in Commit ….
  13. 13. Conditional builds/Build avoidance Commit …. ?
  14. 14. So how do we implement all of that in Jenkins...
  15. 15. Parameterized Trigger plugin, Join plugin (2009)
  16. 16. eXtreme Feedback Panel Plugin (2009)
  17. 17. Hudson -> Jenkins (2011)
  18. 18. Wall display plugin (2011)
  19. 19. Build Pipeline (2011)
  20. 20. Chuck Norris plugin (2011)
  21. 21. JobDSL (2012)
  22. 22. Build flow plugin (2012)
  23. 23. Meanwhile… (2011-2012)
  24. 24. Difference ● SaaS ● Almost no server configuration (web hooks mess, workers etc) ● YAML/Declarative pipelines ● Stored together with code ● By default do not have SCM block ● Always triggered by SCM (or SCM related - like PR) event
  25. 25. Delivery pipeline plugin (2013)
  26. 26. Workflow -> Pipelines -> Jenkinsfile (2014)
  27. 27. What was different - Hacker way ● Imperative ● Groovy and DSL ● Eventually declarative pipelines. Kind of
  28. 28. What was different - Pain ● Burden of legacy ● Plugins support ● Visualization mess ● Security ● nonCPS ● Confusion - declarative vs scripted
  29. 29. What was different ● Shared libraries ● Multibranch ● Resumable pipelines
  30. 30. Fast forward to 2018...
  31. 31. Where are we today? ● GitHub/BitBucket support ● But try doing Gerrit... ● Most of the plugins supported ● Good documentation ● Declarative pipeline… if you don’t go scripted ● Visualisation kind of works… if you don’t go scripted ● Possibly YAML-based pipelines https://jenkins.io/blog/2018/06/15/simple-pull-request-plugin/ ● Still no possibility to restart pipeline from certain point https://issues.jenkins-ci.org/browse/JENKINS-33846
  32. 32. Where would I still go freestyle or scripted? ● Simple utility jobs unrelated to CI/CD of the target - stuff that you don’t put to the Jenkinsfile ● Conditional stages (think test/build avoidance) ● Want to avoid to resuming of the pipeline after restart and do not want to set org.jenkinsci.plugins.workflow.job.properties.DisableResumeJobProperty ● Complex workflow with the need to restart the flow from the certain point
  33. 33. About those conditional stages and restart from checkpoint...
  34. 34. https://issues.jenkins-ci.org/browse/JENKINS-33846
  35. 35. A hacker way in action...
  36. 36. library identifier: 'praqma-shared@master', retriever: modernSCM( [$class: 'GitSCMSource', remote: 'https://github.com/Praqma/shared-pipeline.git', credentialsId: '']) stageWithCheckPoint("ConditionalEcho") { echo "User decided to run me" }
  37. 37. Source https://github.com/Praqma/shared-pipeline/blo b/master/vars/stageWithCheckPoint.groovy
  38. 38. What you see today is only a short moment of the flow
  39. 39. Thanks! andrey9kin@a59.company @andrey9kin

×