Upgrade to Pro — share decks privately, control downloads, hide ads and more …

SPb Jenkins Meetup #0 - Jenkins@ZeroTurnaround

SPb Jenkins Meetup #0 - Jenkins@ZeroTurnaround

My slides from first Jenkins Meetup in Saint-Petersburg, Russia

http://www.meetup.com/St-Petersburg-Jenkins-Meetup/events/226875933/

3329a8ef50ae3388665964637001fcb6?s=128

Sergei Egorov

December 09, 2015
Tweet

Transcript

  1. JENKINS@ZT To CI and beyond…

  2. ABOUTME • Graduated from ITMO University • Big game development

    background: SignusLabs, Social Quantum, Pragmatix, Creative Mobile • Moved to Estonia in 2013 • DevOps Engineer (XRebel team) • <3 OpenSource (contributor to Groovy, Spring Boot, Jenkins plugins, AWS SDK, and many more) • https://github.com/bsideup @bsideup
  3. ABOUTUS • We develop for Java developers • JRebel /

    JRebel for Android™ - code reloads without redeploy • XRebel - lightweight profiler aka “OMG do we really have 1000 DB queries?!” • We pay more money for Jenkins machines than production servers @bsideup
  4. @bsideup

  5. LESSONSLEARNED • One does not simply use single Jenkins for

    all projects • Plugins conflicts • Try to keep your plugins up to date • Automate nodes configuration (Ansible, Chef, Docker, etc) • Continuous Delivery with Jenkins is challenging @bsideup
  6. PLAINJENKINS @bsideup • Can be configured only with UI •

    No job config history and audit • Doesn’t allow templating of jobs • Single Job oriented • Not a good choice for Continuous Delivery
  7. How to solve?

  8. WITHPLUGINS

  9. CONFIG HISTORY PLUGIN @bsideup • Tracks changes in Job’s configuration

    by comparing XML representations • Each change is bounded to user who did it • “Must have” for audition • Provides “Rollback” functionality • No configuration required to start
  10. CONFIG HISTORY PLUGIN @bsideup

  11. JOB DSL PLUGIN mavenJob(buildJobName) {
 label 'xr-build'
 
 scm {


    hg(“ssh://hg@bitbucket.org/zeroturnaround/…”)
 }
 
 triggers {
 scm("H/5 * * * *")
 }
 
 mavenInstallation 'Maven 3.2.x'
 goals("clean package")
 
 publishers {
 archiveArtifacts(“target/**”)
 }
 } @bsideup
  12. PROS @bsideup • Groovy DSL • Reuse job definitions, steps,

    etc • Could be reviewed as code • A lot of bindings for plugins • Configuration stored in VCS • Want to change job? Send pull request! • Auditable • History and rollbacks
  13. CONS @bsideup • Groovy DSL :) • Some knowledge about

    Jenkins config internals is required • No bindings for non-popular plugins (but solvable)
  14. CUSTOMDSL @bsideup freeStyleJob("xr-sharing-functional-tests-${environment.name}") {
 label 'xr-test-integration'
 
 scm {
 git('git@bitbucket.org:zeroturnaround/xr-sharing-tests.git')

    {
 clean()
 }
 }
 
 steps {
 steps {
 gradle('clean cucumber', "-Pgeb.build.baseUrl=${environment.url}")
 }
 }
 
 configure { project ->
 project / publishers << 'net.masterthought.jenkins.CucumberReportPublisher' {
 jsonReportDirectory 'build/reports/'
 pluginUrlPath ''
 fileIncludePattern ''
 fileExcludePattern ''
 }
 }
 }
  15. CONTINUOUSDELIVERY @bsideup

  16. DELIVERY PIPELINE PLUGIN @bsideup • Very easy to configure -

    just specify “first job in pipeline” • Great overview of current release status • Each step is a separate job, steps trigger other steps • Manual steps (i.e. “promote to staging”)
  17. OURFORK @bsideup • Front-end was completely rewritten from jQuery to

    ReactJS • Able to handle very complex pipelines • Allow tracking of changes between different stages (i.e. dev, qa, prod) • Most of this changes will be contributed back (a few already are)
  18. None
  19. None
  20. But we miss something…

  21. Theming!

  22. None
  23. ZTTHEME @bsideup • Theme for “Simple Theme” plugin • Fork

    of “Jenkins Atlassian Theme” • Available at GitHub: 
 https://github.com/zeroturnaround/jenkins-atlassian-theme
  24. So Jenkins is cute… Again.

  25. THANKYOU!