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/

Sergei Egorov

December 09, 2015
Tweet

More Decks by Sergei Egorov

Other Decks in Programming

Transcript

  1. 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
  2. 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
  3. 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
  4. 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
  5. 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
  6. JOB DSL PLUGIN mavenJob(buildJobName) {
 label 'xr-build'
 
 scm {


    hg(“ssh://[email protected]/zeroturnaround/…”)
 }
 
 triggers {
 scm("H/5 * * * *")
 }
 
 mavenInstallation 'Maven 3.2.x'
 goals("clean package")
 
 publishers {
 archiveArtifacts(“target/**”)
 }
 } @bsideup
  7. 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
  8. CONS @bsideup • Groovy DSL :) • Some knowledge about

    Jenkins config internals is required • No bindings for non-popular plugins (but solvable)
  9. CUSTOMDSL @bsideup freeStyleJob("xr-sharing-functional-tests-${environment.name}") {
 label 'xr-test-integration'
 
 scm {
 git('[email protected]: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 ''
 }
 }
 }
  10. 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”)
  11. 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)
  12. ZTTHEME @bsideup • Theme for “Simple Theme” plugin • Fork

    of “Jenkins Atlassian Theme” • Available at GitHub: 
 https://github.com/zeroturnaround/jenkins-atlassian-theme