puppet camp phoenix 2015: continuous integration using puppet (intermediate)

11
Continuous Integration with Puppet

Upload: puppet-labs

Post on 14-Jul-2015

462 views

Category:

Software


2 download

TRANSCRIPT

Page 1: Puppet Camp Phoenix 2015:  Continuous Integration Using Puppet (Intermediate)

Continuous Integration with Puppet

Page 2: Puppet Camp Phoenix 2015:  Continuous Integration Using Puppet (Intermediate)

Miguel Zuniga

Arch / Lead / Principal / Speaker

since v. 0.22.2

Page 3: Puppet Camp Phoenix 2015:  Continuous Integration Using Puppet (Intermediate)

Agenda

● Continuous Integration● How puppet can help us on CI?● Puppet Environments = CI Environments● Package, Test, Deploy● Infrastructure as Code● Puppet and CI● Q&A

Page 4: Puppet Camp Phoenix 2015:  Continuous Integration Using Puppet (Intermediate)

Continuous Integration

Page 5: Puppet Camp Phoenix 2015:  Continuous Integration Using Puppet (Intermediate)

How puppet can help use on CI?

● Automate configuration of Infrastructure● Automate package deployment● Keep track of changes done at the infra layer● Control where and when gets software setup● Build server becomes… a build server.

Page 6: Puppet Camp Phoenix 2015:  Continuous Integration Using Puppet (Intermediate)

Puppet Environments = CI Environments

● Development, Test, Production● Drop your puppet code in SCM● Let CI merge/squash puppet environments● Provide an isolated view and a way to

duplicate the application environments as many times as needed.

Page 7: Puppet Camp Phoenix 2015:  Continuous Integration Using Puppet (Intermediate)

Package, Test, Deploy● Always package your software (deb, rpm,

gem, pip)

● Use puppet package resources only

● NEVER DO

exec {cmd => “install my war”

}

● Define one standard sequential numeric version convention… v0.xxx and v124.0

● To automate deployment properly code puppet using requires in a recursive way

class repo {yumrepo {name => “epel”baseurl => “http://epel”

} }

class mypackage {require repopackage { “myapplication”: ensure => 1.2 }

}

node { include mypackage }

Page 8: Puppet Camp Phoenix 2015:  Continuous Integration Using Puppet (Intermediate)

Infrastructure as Code

With puppet controlling your infrastructure:● Infra becomes another Product just like any other

application

● Infra starts adding features and bugfixes

● Infra can align with the SDLC of your application

● Deploy to thousand of nodes with confidence

Page 9: Puppet Camp Phoenix 2015:  Continuous Integration Using Puppet (Intermediate)

Puppet and CI

Page 10: Puppet Camp Phoenix 2015:  Continuous Integration Using Puppet (Intermediate)

Puppet and CI1. Developers submit application code to SCM2. Ops submit infrastructure code to SCM3. Build server pulls the application code, compiles it, creates the package and uploads it to the

repository4. Build server pulls the infrastructure code, parses it, simulates it and merges the changes against

the target environment5. Build server instructs the puppet master to pull specific tag of the target environment 6. Puppet master takes care of running the puppet code in the target environment, configure and

deploy the application7. Testing framework can run once deploy is done.8. Rinse and repeat

With puppet you are not compiling, packaging and deploying an application… you are compiling, packaging and deploying your whole environment..

Page 11: Puppet Camp Phoenix 2015:  Continuous Integration Using Puppet (Intermediate)

Q&AThank you

tweet @mike_zunigagithub.com/mikezuniga

G+ +miguelzunigaLinkedin /in/miguelzuniga