treating deployments as code with puppet and the atlassian...
TRANSCRIPT
Puppet Camp, Geneva July 2012www.celix.at
Christoph LeithnerJuly 2012
Treating Deployments as Code with Puppet and the Atlassian
Toolsuite
Puppet Camp, Geneva
Puppet Camp, Geneva July 2012www.celix.at
Who is celix?
Puppet Labs Partner
Atlassian Expert
IT Service Management (ITSM)
Continuous Deployment und DevOps
Agile Development
Puppet Camp, Geneva July 2012www.celix.at
Deployments as code
Puppet Manifests
Nearly all Puppet Manifests belong in Modules
Module = Directory with a defined structre
Module = Manifests + Files + Templates + Plugins
Module should contain Tests and Examples
Puppet Camp, Geneva July 2012www.celix.at
Puppet Forge
Repository of Modules contributed by users
Find, install, upgrade and uninstall Modules
puppet module subcommand (since 2.7.14)
Manage module dependencies
Modules contain related code and should be as
self contained as possible
Puppet Camp, Geneva July 2012www.celix.at
Working with Puppet Modules
Using Puppet Forge Modules
Developing your own Modules
Managing Dependencies
Tracking Changes
Puppet Camp, Geneva July 2012www.celix.at
Puppet Environments
During development and testing multiple
versions of the modules exist
Environments enable the use of these different
sets of Modules
Different modulepath for each environment
Common names for environments: production,
testing, development or trunk
Puppet Camp, Geneva July 2012www.celix.at
Puppet Environments
Modulepath has to be defined:
Own [config block] in puppet.conf for
each environment
Definition referencing the $environment
variable – Dynamic Environments
Puppet Camp, Geneva July 2012www.celix.at
Version Control Strategies
Version the environment or modules folder
Check out only tags to the „production“
environment
Develop modules in „trunk“environment or
Create branches for „development“ and
„testing“ environments
see Pro Puppet Book – Chapter 3
Puppet Camp, Geneva July 2012www.celix.at
Version Control Strategies
Version each module in a separate repo and use a
superproject to point to the modules. (Git
submodules and Mercurial superproject)
see http://jedi.be/blog/2011/12/05/puppet-versioning-like-a-pro/ by P. Debois
New: Use the puppet module subcommand to
manage the Modules in a directory under version
control
Puppet Camp, Geneva July 2012www.celix.at
Multiple Module Directory Example
forge
modules
own_dev
modules
forge_dev
modules
Version modules directory for own Modules (own_dev)
Use Superproject with submodules for Puppet Forge Modules (forge)
Version individual Modules for own Puppet Forge Development (forge_dev)
Puppet Camp, Geneva July 2012www.celix.at
Developing a Module
Code the feature
Check the syntax
Check code against style guidelines
Run Tests: cucumber-puppet, rspec-puppet see http://ruby.dzone.com/articles/puppet-unit-testing-pro by P. Debois
Deploy to environment on Puppet Master
Apply catalog to dedicated machines
Puppet Camp, Geneva July 2012www.celix.at
Geppetto – Puppet IDE
Based on Eclipse
Supports Puppet Project Types
Version Control Integration (Git, SVN)
Eclipse Task Management (Mylyn)
Adds Puppet Support to your existing Eclipse
Installation
More info: http://cloudsmith.github.com/geppetto/
Puppet Camp, Geneva July 2012www.celix.at
Atlassian Bamboo
Manage your Puppet Environments with Bamboo
Build plan for every environment
Provides „A Task for everything“ (Git, puppet
subcommands, mcollective, rspec-puppet, puppet-
lint, rake, git-rake, Dashboard Rake API,...)
Automate Development and Release process
No longer use the shell on your Puppet Master
Puppet Camp, Geneva July 2012www.celix.at
Stay in You IDE
Automatic Plan Branching
Atlassian Bamboo
Feature Environments (Branches)
Effortlessly add new plans for
branches to your build system
Automatic or at the push of a button
Atlassian IDE Connector
for Eclipse
Start builds from your IDE
Puppet Camp, Geneva July 2012www.celix.at
Automatic Branch Merging
Atlassian Bamboo
Two Strategies:
The "Gatekeeper“: Merges
changes from your branch into
the main link and builds the
result
The "Build Updater“: Merges the
main line into the branch and
build the combined code.
Optional commit after a
successful build
Puppet Camp, Geneva July 2012www.celix.at
Manual Stages
One-Click Release Process
Atlassian Bamboo
Initiate your release process to
the „production“ environment
from JIRA with one click
Automate what you can,
one step at a time
Pause the plan at manual
stages
Puppet Camp, Geneva July 2012www.celix.at
Manage Your Application Life Cycle with the Atlassian Toolsuite
Puppet Camp, Geneva July 2012www.celix.at
Atlassian JIRA
Define Your Own ProcessesDifferent Process for each Issue Type
Visualize Your WorkflowVisual Workflow Editor
Users can view current status of the
workflow
Puppet Camp, Geneva July 2012www.celix.at
Atlassian JIRA
Integrate with CIAtlassian Bamboo
Build Notifications
Release Management
Agile Project PlanningAtlassian GreenHopper AddOn
Scrum + Kanban = ScrumBan
Use agile practices implementing
your Modules
Puppet Camp, Geneva July 2012www.celix.at
Measure Cycle Time
Analyze Trends
Atlassian GreenHopper
Time an Issue spends in progress
Cumulative Flow Diagram
See where work is building up
Puppet Camp, Geneva July 2012www.celix.at
Encourage Code Review
Atlassian JIRA
Atlassian Crucible
Ensure a second set of eyes looks
over every line of code
Link Issues to Source CodeAtlassian Fisheye
Use Issue IDs in Commit Messages
Puppet Camp, Geneva July 2012www.celix.at
Real Time Dev Activity
Development Forensics
Atlassian Fisheye
Identify source that caused builds
to fail
How did a change get introduced
into the codebase
Diagnose and solve problems
Puppet Camp, Geneva July 2012www.celix.at
Issues to Reviews
Atlassian Crucible
Browse Code Reviews associated
with an Issue or Project
One Click Review creation from JIRA
Reviews to IssuesView Issues related to Code reviews
Create JIRA Issue from Cucible
review comments
Puppet Camp, Geneva July 2012www.celix.at
Code Discussions
Atlassian Crucible
Reviewing code is learning
code
Share best Practices
No Meetings RequiredWorkflow based Review
Review Changesets
Review Snippets
Puppet Camp, Geneva July 2012www.celix.at
Puppet Camp, Geneva July 2012www.celix.at
Summary
Your Puppet Modules are code, just like the
webapp you are deploying:
Use the Puppet IDE Geppetto
Use the Atlassian Bamboo Buildplans to manage
your Puppet Environments
Manage your agile Module development with JIRA
and GreenHopper
Use Code reviews with Fisheye and Crucible
Puppet Camp, Geneva July 2012www.celix.at
Thank you!