Automated Chef cookbook testing
with Drone.IO and Github
paul.czarkowski@rackspace.com
@pczarkowski
$ whoami pczarkowski
$ whoami pczarkowski
$ whoami pczarkowski
$ whoami pczarkowski
I <3 Docker
0.20
ZNCaaS
Openstack - Dockenstack, Nova-Docker, Solum
http://tech.paulczar.net
http://github.com/paulczar
ht...
Chef Cookbook - Docker
Installs Docker
http://community.opscode.com/cookbooks/docker
https://github.com/bflad/chef-docker
Chef Cookbook - Docker
Run your own Registry
http://community.opscode.com/cookbooks/docker
Chef Cookbook - Docker
Backup container
http://community.opscode.com/cookbooks/docker
Chef Cookbook - Docker
just like trusted builds, only cheffy.
http://community.opscode.com/cookbooks/docker
Using Chef in Dockerfile
Run chef-solo in Dockerfile
EZBake
Converge Container on the fly
http://community.opscode.com/cookbooks/docker
Knife container
?
What is Drone ?
http://drone.io
http://github.com/drone/drone
SaaS or Self Hosted
Written in Go
Uses Docker to run tests/b...
How it works ?
Watches git repo containing `.drone.yml`
Clones repo on `git push`
Creates Docker image
How it works ?
Runs Docker image
Runs a series of commands
Performs action based on result
Why use Drone ?
Same tooling for both Public and Private
Ultra fast - Docker FTW
Opensource
It’s not all rainbows and unicorns
Local user auth only
Single server
UI and Documentation
Installing Drone
https://github.com/justincampbell/chef-drone
Installs drone via chef
Installing Drone
$ curl get.docker.io | bash
$ wget http://downloads.drone.io/latest/drone.deb
$ sudo dpkg -i drone.deb
Configuring Drone
http://drone.example.com/install
https://github.com/settings/applications/new
Oauth Proxy
https://github.com/movableink/doorman
.drone.yml
.drone.yml
.drone.yml
Drone CLI
$ drone build /tmp/example_application
parses .drone.yml
performs build
drone-wall
https://github.com/drone/drone-wall
As a NoOp I need a development
workflow with automated CI for
building reliable infrastructure using
chef cookbooks for my...
“Chef cookbooks
are code.”
culture, culture, something,
learning organization, something,
devops...
Chef Community Testing Ecosystem
http://icanhazwordcloud.io
Test your Cookbooks
STYLE / SYNTAX tests
UNIT tests
INTEGRATION tests
Shameless plug… Meez
A tool I wrote … to scratch an itch.
generates a chef cookbook with plumbing for all the testing
tool...
Generate a testable cookbook
Run tests!
Short feedback loops
Guard: run tests every change
Git Hooks: refuse to commit if failed tests
Self Discipline!
Chef cookbooks are code.
Use Source Control
http://github.com
SaaS or Self Hosted
Github Pull Request Workflow
Questions ?
THANKYOU!
@pczarkowski
paul.czarkowski@rackspace.com
Dockercon - Building a Chef cookbook testing pipeline with Drone.IO and Docker
Dockercon - Building a Chef cookbook testing pipeline with Drone.IO and Docker
Dockercon - Building a Chef cookbook testing pipeline with Drone.IO and Docker
Dockercon - Building a Chef cookbook testing pipeline with Drone.IO and Docker
Dockercon - Building a Chef cookbook testing pipeline with Drone.IO and Docker
Dockercon - Building a Chef cookbook testing pipeline with Drone.IO and Docker
Dockercon - Building a Chef cookbook testing pipeline with Drone.IO and Docker
Dockercon - Building a Chef cookbook testing pipeline with Drone.IO and Docker
Dockercon - Building a Chef cookbook testing pipeline with Drone.IO and Docker
Dockercon - Building a Chef cookbook testing pipeline with Drone.IO and Docker
Dockercon - Building a Chef cookbook testing pipeline with Drone.IO and Docker
Dockercon - Building a Chef cookbook testing pipeline with Drone.IO and Docker
Upcoming SlideShare
Loading in …5
×

Dockercon - Building a Chef cookbook testing pipeline with Drone.IO and Docker

2,291 views

Published on

Building a framework for developing and maintaining chef cookbooks with automated testing and code review using opensource tools. I will walk through setting up Drone.IO (docker based CI) and hooking it up with Github ( regular or enterprise ), securing it behind an Oauth proxy, and configuring appropriate git hooks to automate testing process. I will then show how to use tools such as meez, guard, chefspec, testkitchen to shorten the feedback loop on errors to merely a few seconds, as well as some workflow ideas for gating and merging changes in github for Chef Cookbooks with multiple contributors.

Published in: Technology, Self Improvement
0 Comments
7 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,291
On SlideShare
0
From Embeds
0
Number of Embeds
212
Actions
Shares
0
Downloads
22
Comments
0
Likes
7
Embeds 0
No embeds

No notes for slide

Dockercon - Building a Chef cookbook testing pipeline with Drone.IO and Docker

  1. 1. Automated Chef cookbook testing with Drone.IO and Github paul.czarkowski@rackspace.com @pczarkowski
  2. 2. $ whoami pczarkowski
  3. 3. $ whoami pczarkowski
  4. 4. $ whoami pczarkowski
  5. 5. $ whoami pczarkowski
  6. 6. I <3 Docker 0.20 ZNCaaS Openstack - Dockenstack, Nova-Docker, Solum http://tech.paulczar.net http://github.com/paulczar https://index.docker.io/u/paulczar/
  7. 7. Chef Cookbook - Docker Installs Docker http://community.opscode.com/cookbooks/docker https://github.com/bflad/chef-docker
  8. 8. Chef Cookbook - Docker Run your own Registry http://community.opscode.com/cookbooks/docker
  9. 9. Chef Cookbook - Docker Backup container http://community.opscode.com/cookbooks/docker
  10. 10. Chef Cookbook - Docker just like trusted builds, only cheffy. http://community.opscode.com/cookbooks/docker
  11. 11. Using Chef in Dockerfile Run chef-solo in Dockerfile
  12. 12. EZBake Converge Container on the fly http://community.opscode.com/cookbooks/docker
  13. 13. Knife container ?
  14. 14. What is Drone ? http://drone.io http://github.com/drone/drone SaaS or Self Hosted Written in Go Uses Docker to run tests/builds
  15. 15. How it works ? Watches git repo containing `.drone.yml` Clones repo on `git push` Creates Docker image
  16. 16. How it works ? Runs Docker image Runs a series of commands Performs action based on result
  17. 17. Why use Drone ? Same tooling for both Public and Private Ultra fast - Docker FTW Opensource
  18. 18. It’s not all rainbows and unicorns Local user auth only Single server UI and Documentation
  19. 19. Installing Drone https://github.com/justincampbell/chef-drone Installs drone via chef
  20. 20. Installing Drone $ curl get.docker.io | bash $ wget http://downloads.drone.io/latest/drone.deb $ sudo dpkg -i drone.deb
  21. 21. Configuring Drone http://drone.example.com/install
  22. 22. https://github.com/settings/applications/new
  23. 23. Oauth Proxy https://github.com/movableink/doorman
  24. 24. .drone.yml
  25. 25. .drone.yml
  26. 26. .drone.yml
  27. 27. Drone CLI $ drone build /tmp/example_application parses .drone.yml performs build
  28. 28. drone-wall https://github.com/drone/drone-wall
  29. 29. As a NoOp I need a development workflow with automated CI for building reliable infrastructure using chef cookbooks for my DevOps environment.
  30. 30. “Chef cookbooks are code.”
  31. 31. culture, culture, something, learning organization, something, devops...
  32. 32. Chef Community Testing Ecosystem http://icanhazwordcloud.io
  33. 33. Test your Cookbooks STYLE / SYNTAX tests UNIT tests INTEGRATION tests
  34. 34. Shameless plug… Meez A tool I wrote … to scratch an itch. generates a chef cookbook with plumbing for all the testing tools in the previous slides … and more.
  35. 35. Generate a testable cookbook
  36. 36. Run tests!
  37. 37. Short feedback loops Guard: run tests every change Git Hooks: refuse to commit if failed tests Self Discipline!
  38. 38. Chef cookbooks are code. Use Source Control http://github.com SaaS or Self Hosted
  39. 39. Github Pull Request Workflow
  40. 40. Questions ?
  41. 41. THANKYOU! @pczarkowski paul.czarkowski@rackspace.com

×