27
Puppet Camp, Geneva July 2012 www.celix.at Christoph Leithner July 2012 Treating Deployments as Code with Puppet and the Atlassian Toolsuite Puppet Camp, Geneva

Treating Deployments as Code with Puppet and the Atlassian ...schedule2012.rmll.info/IMG/pdf/puppetcamp-geneva... · Atlassian Bamboo Feature Environments (Branches) Effortlessly

  • Upload
    others

  • View
    12

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Treating Deployments as Code with Puppet and the Atlassian ...schedule2012.rmll.info/IMG/pdf/puppetcamp-geneva... · Atlassian Bamboo Feature Environments (Branches) Effortlessly

Puppet Camp, Geneva July 2012www.celix.at

Christoph LeithnerJuly 2012

Treating Deployments as Code with Puppet and the Atlassian

Toolsuite

Puppet Camp, Geneva

Page 2: Treating Deployments as Code with Puppet and the Atlassian ...schedule2012.rmll.info/IMG/pdf/puppetcamp-geneva... · Atlassian Bamboo Feature Environments (Branches) Effortlessly

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

Page 3: Treating Deployments as Code with Puppet and the Atlassian ...schedule2012.rmll.info/IMG/pdf/puppetcamp-geneva... · Atlassian Bamboo Feature Environments (Branches) Effortlessly

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

Page 4: Treating Deployments as Code with Puppet and the Atlassian ...schedule2012.rmll.info/IMG/pdf/puppetcamp-geneva... · Atlassian Bamboo Feature Environments (Branches) Effortlessly

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

Page 5: Treating Deployments as Code with Puppet and the Atlassian ...schedule2012.rmll.info/IMG/pdf/puppetcamp-geneva... · Atlassian Bamboo Feature Environments (Branches) Effortlessly

Puppet Camp, Geneva July 2012www.celix.at

Working with Puppet Modules

Using Puppet Forge Modules

Developing your own Modules

Managing Dependencies

Tracking Changes

Page 6: Treating Deployments as Code with Puppet and the Atlassian ...schedule2012.rmll.info/IMG/pdf/puppetcamp-geneva... · Atlassian Bamboo Feature Environments (Branches) Effortlessly

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

Page 7: Treating Deployments as Code with Puppet and the Atlassian ...schedule2012.rmll.info/IMG/pdf/puppetcamp-geneva... · Atlassian Bamboo Feature Environments (Branches) Effortlessly

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

Page 8: Treating Deployments as Code with Puppet and the Atlassian ...schedule2012.rmll.info/IMG/pdf/puppetcamp-geneva... · Atlassian Bamboo Feature Environments (Branches) Effortlessly

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

Page 9: Treating Deployments as Code with Puppet and the Atlassian ...schedule2012.rmll.info/IMG/pdf/puppetcamp-geneva... · Atlassian Bamboo Feature Environments (Branches) Effortlessly

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

Page 10: Treating Deployments as Code with Puppet and the Atlassian ...schedule2012.rmll.info/IMG/pdf/puppetcamp-geneva... · Atlassian Bamboo Feature Environments (Branches) Effortlessly

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)

Page 11: Treating Deployments as Code with Puppet and the Atlassian ...schedule2012.rmll.info/IMG/pdf/puppetcamp-geneva... · Atlassian Bamboo Feature Environments (Branches) Effortlessly

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

Page 12: Treating Deployments as Code with Puppet and the Atlassian ...schedule2012.rmll.info/IMG/pdf/puppetcamp-geneva... · Atlassian Bamboo Feature Environments (Branches) Effortlessly

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/

Page 13: Treating Deployments as Code with Puppet and the Atlassian ...schedule2012.rmll.info/IMG/pdf/puppetcamp-geneva... · Atlassian Bamboo Feature Environments (Branches) Effortlessly

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

Page 14: Treating Deployments as Code with Puppet and the Atlassian ...schedule2012.rmll.info/IMG/pdf/puppetcamp-geneva... · Atlassian Bamboo Feature Environments (Branches) Effortlessly

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

Page 15: Treating Deployments as Code with Puppet and the Atlassian ...schedule2012.rmll.info/IMG/pdf/puppetcamp-geneva... · Atlassian Bamboo Feature Environments (Branches) Effortlessly

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

Page 16: Treating Deployments as Code with Puppet and the Atlassian ...schedule2012.rmll.info/IMG/pdf/puppetcamp-geneva... · Atlassian Bamboo Feature Environments (Branches) Effortlessly

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

Page 17: Treating Deployments as Code with Puppet and the Atlassian ...schedule2012.rmll.info/IMG/pdf/puppetcamp-geneva... · Atlassian Bamboo Feature Environments (Branches) Effortlessly

Puppet Camp, Geneva July 2012www.celix.at

Manage Your Application Life Cycle with the Atlassian Toolsuite

Page 18: Treating Deployments as Code with Puppet and the Atlassian ...schedule2012.rmll.info/IMG/pdf/puppetcamp-geneva... · Atlassian Bamboo Feature Environments (Branches) Effortlessly

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

Page 19: Treating Deployments as Code with Puppet and the Atlassian ...schedule2012.rmll.info/IMG/pdf/puppetcamp-geneva... · Atlassian Bamboo Feature Environments (Branches) Effortlessly

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

Page 20: Treating Deployments as Code with Puppet and the Atlassian ...schedule2012.rmll.info/IMG/pdf/puppetcamp-geneva... · Atlassian Bamboo Feature Environments (Branches) Effortlessly

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

Page 21: Treating Deployments as Code with Puppet and the Atlassian ...schedule2012.rmll.info/IMG/pdf/puppetcamp-geneva... · Atlassian Bamboo Feature Environments (Branches) Effortlessly

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

Page 22: Treating Deployments as Code with Puppet and the Atlassian ...schedule2012.rmll.info/IMG/pdf/puppetcamp-geneva... · Atlassian Bamboo Feature Environments (Branches) Effortlessly

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

Page 23: Treating Deployments as Code with Puppet and the Atlassian ...schedule2012.rmll.info/IMG/pdf/puppetcamp-geneva... · Atlassian Bamboo Feature Environments (Branches) Effortlessly

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

Page 24: Treating Deployments as Code with Puppet and the Atlassian ...schedule2012.rmll.info/IMG/pdf/puppetcamp-geneva... · Atlassian Bamboo Feature Environments (Branches) Effortlessly

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

Page 25: Treating Deployments as Code with Puppet and the Atlassian ...schedule2012.rmll.info/IMG/pdf/puppetcamp-geneva... · Atlassian Bamboo Feature Environments (Branches) Effortlessly

Puppet Camp, Geneva July 2012www.celix.at

Page 26: Treating Deployments as Code with Puppet and the Atlassian ...schedule2012.rmll.info/IMG/pdf/puppetcamp-geneva... · Atlassian Bamboo Feature Environments (Branches) Effortlessly

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

Page 27: Treating Deployments as Code with Puppet and the Atlassian ...schedule2012.rmll.info/IMG/pdf/puppetcamp-geneva... · Atlassian Bamboo Feature Environments (Branches) Effortlessly

Puppet Camp, Geneva July 2012www.celix.at

Thank you!