Diese Präsentation wurde erfolgreich gemeldet.
Wir verwenden Ihre LinkedIn Profilangaben und Informationen zu Ihren Aktivitäten, um Anzeigen zu personalisieren und Ihnen relevantere Inhalte anzuzeigen. Sie können Ihre Anzeigeneinstellungen jederzeit ändern.
Cookbook CI with 
Jenkins 
Part 1
Who Am I? 
• "zts" most places on the internet 
• Mostly Ops, Background, Mostly 
• Co-founder Elastera
Who Are You?
Cookbook Testing 
• foodcritic, chefspec, test-kitchen 
• Get things right 
• Keep things right
CI Servers 
• System for running actions on every commit 
• Identify problems early 
• Jenkins, GoCD, TravisCI, Wercker, e...
Why Jenkins? 
• Mature 
• Extensible 
• Good Chef Cookbook 
• Free
Why Not Jenkins? 
• TMTOWTDI 
• XML, so much XML 
• Automation is not a joy
Jenkins Cookbook 
• Install Jenkins & Plugins 
• Create jobs 
• Run commands and scripts
Previously… 
• Cooking With Jenkins 
• ...and Kitchen, and Docker
Subsequently… 
• Federated Jenkins with Chef 
• github:erichelgeson/jenkins-chef-dsl/
Basic Configuration 
• Install Plugins 
• Configure Plugins 
• Configure Jenkins
Installing Plugins 
• Idempotent 
• No dependency resolution 
• Restart may be required
Plugin Configuration 
• XML :( 
• ...containing module version strings :(( 
• Hold nose and use cookbook_file
Jenkins Configuration
Creating Jobs 
• jenkins_job 
• Job DSL plugin 
• Jenkins Job Builder
Pipeline 
• Foodcritic 
• Chefspec 
• Kitchen 
• Publish
And after publish? 
• That's why this is Part 1...
Foodcritic 
• Warnings plugin :) 
• XML config :(
Chefspec 
• yarjuf gem 
• Publish JUnit test result report
Test Kitchen 
• kitchen-docker 
• Matrix jobs 
• EnvInject and AnsiColor plugins
Berkshelf 
• upload to Chef server 
• record version as artifact
Berkshelf 
• curl -s https://jenkins.example/job/berks-upload/ 
lastSuccessfulBuild/artifact/VERSION
Gluing it together 
• Publish Artifact 
• Copy Artifact 
• Build Pipeline
Pipelines 
• Build Pipeline plugin 
• Build Graph View plugin 
• Build Flow DSL 
• ...and more
Build Pipeline
What's Missing? 
• JUnit output from serverspec 
• View most recent run of all pipelines 
• Notifications
Not the whole story... 
• Testing a set of cookbooks 
• Testing multiple nodes 
• Promoting releases
Summary 
• Not that hard to get started 
• Immediately valuable 
• Share your work!
Questions?
Resources 
http://www.cryptocracy.com/blog/2014/01/03/cooking-with-jenkins-test-kitchen-and-docker/ 
https://erichelgeson....
Thankyou 
Twitter: @zts 
email: zts@elastera.com
CLUG 2014-10 - Cookbook CI with Jenkins
CLUG 2014-10 - Cookbook CI with Jenkins
CLUG 2014-10 - Cookbook CI with Jenkins
CLUG 2014-10 - Cookbook CI with Jenkins
CLUG 2014-10 - Cookbook CI with Jenkins
CLUG 2014-10 - Cookbook CI with Jenkins
CLUG 2014-10 - Cookbook CI with Jenkins
CLUG 2014-10 - Cookbook CI with Jenkins
CLUG 2014-10 - Cookbook CI with Jenkins
Nächste SlideShare
Wird geladen in …5
×

CLUG 2014-10 - Cookbook CI with Jenkins

2.045 Aufrufe

Veröffentlicht am

An overview of how I'm using Chef to automate Jenkins to test Chef cookbooks.

Veröffentlicht in: Software

CLUG 2014-10 - Cookbook CI with Jenkins

  1. 1. Cookbook CI with Jenkins Part 1
  2. 2. Who Am I? • "zts" most places on the internet • Mostly Ops, Background, Mostly • Co-founder Elastera
  3. 3. Who Are You?
  4. 4. Cookbook Testing • foodcritic, chefspec, test-kitchen • Get things right • Keep things right
  5. 5. CI Servers • System for running actions on every commit • Identify problems early • Jenkins, GoCD, TravisCI, Wercker, etc
  6. 6. Why Jenkins? • Mature • Extensible • Good Chef Cookbook • Free
  7. 7. Why Not Jenkins? • TMTOWTDI • XML, so much XML • Automation is not a joy
  8. 8. Jenkins Cookbook • Install Jenkins & Plugins • Create jobs • Run commands and scripts
  9. 9. Previously… • Cooking With Jenkins • ...and Kitchen, and Docker
  10. 10. Subsequently… • Federated Jenkins with Chef • github:erichelgeson/jenkins-chef-dsl/
  11. 11. Basic Configuration • Install Plugins • Configure Plugins • Configure Jenkins
  12. 12. Installing Plugins • Idempotent • No dependency resolution • Restart may be required
  13. 13. Plugin Configuration • XML :( • ...containing module version strings :(( • Hold nose and use cookbook_file
  14. 14. Jenkins Configuration
  15. 15. Creating Jobs • jenkins_job • Job DSL plugin • Jenkins Job Builder
  16. 16. Pipeline • Foodcritic • Chefspec • Kitchen • Publish
  17. 17. And after publish? • That's why this is Part 1...
  18. 18. Foodcritic • Warnings plugin :) • XML config :(
  19. 19. Chefspec • yarjuf gem • Publish JUnit test result report
  20. 20. Test Kitchen • kitchen-docker • Matrix jobs • EnvInject and AnsiColor plugins
  21. 21. Berkshelf • upload to Chef server • record version as artifact
  22. 22. Berkshelf • curl -s https://jenkins.example/job/berks-upload/ lastSuccessfulBuild/artifact/VERSION
  23. 23. Gluing it together • Publish Artifact • Copy Artifact • Build Pipeline
  24. 24. Pipelines • Build Pipeline plugin • Build Graph View plugin • Build Flow DSL • ...and more
  25. 25. Build Pipeline
  26. 26. What's Missing? • JUnit output from serverspec • View most recent run of all pipelines • Notifications
  27. 27. Not the whole story... • Testing a set of cookbooks • Testing multiple nodes • Promoting releases
  28. 28. Summary • Not that hard to get started • Immediately valuable • Share your work!
  29. 29. Questions?
  30. 30. Resources http://www.cryptocracy.com/blog/2014/01/03/cooking-with-jenkins-test-kitchen-and-docker/ https://erichelgeson.github.io/blog/2014/05/10/automating-your-automation-federated-jenkins-with-chef/ http://atomic-penguin.github.io/blog/2014/05/16/stupid-jenkins-tricks-part-2-cookbook-pipelines/ http://www.hurryupandwait.io/blog/using-git-to-version-stamp-chef-artifacts https://github.com/jenkinsci/job-dsl-plugin/wiki https://wiki.jenkins-ci.org/display/JENKINS/Build+Pipeline+Plugin https://wiki.jenkins-ci.org/display/JENKINS/Building+a+matrix+project
  31. 31. Thankyou Twitter: @zts email: zts@elastera.com

×