+ All Categories
Home > Documents > Build Automation 101

Build Automation 101

Date post: 15-Jan-2015
Category:
Upload: martin-jackson
View: 5,126 times
Download: 2 times
Share this document with a friend
Description:
Build Automation 101:A Presentation on the current tools my Web Operations team uses to build and deploy code.
Popular Tags:
68
Transcript
Page 1: Build Automation 101
Page 2: Build Automation 101

Agenda

Page 3: Build Automation 101
Page 4: Build Automation 101
Page 5: Build Automation 101
Page 6: Build Automation 101

Fast and Easy Deploys

• From Heath RobinsonFrom Heath RobinsonFrom Heath RobinsonFrom Heath Robinson

Page 7: Build Automation 101

Fast and Easy Deploys

• From Heath Robinson to Production LineFrom Heath Robinson to Production LineFrom Heath Robinson to Production LineFrom Heath Robinson to Production Line

Page 8: Build Automation 101
Page 9: Build Automation 101
Page 10: Build Automation 101
Page 11: Build Automation 101

Eliminating Configuration Drift

• Once deployed a machine will Once deployed a machine will Once deployed a machine will Once deployed a machine will inevitably drift from a known stateinevitably drift from a known stateinevitably drift from a known stateinevitably drift from a known state

Page 12: Build Automation 101

Infrastructure as Code

• Synthesizing machines from a known codebase

Page 13: Build Automation 101
Page 14: Build Automation 101
Page 15: Build Automation 101
Page 16: Build Automation 101

Operating System Platform

• Customisable• Easily automated• Packaging friendly• Free alternatives available

Page 17: Build Automation 101

http://www.1900s.org.uk/life-times-images/cobbler-shop.jpg

Page 18: Build Automation 101

http://www.1900s.org.uk/life-times-images/cobbler-shop.jpg

$ info cobbler

Cobbler is a Linux installation server that

allows for rapid setup of network installation

environments. It glues together and automates

many associated Linux tasks so you do not have to

hop between lots of various commands and

applications when rolling out new systems, and,

in some cases, changing existing ones.

$

Page 19: Build Automation 101

http://www.1900s.org.uk/life-times-images/cobbler-shop.jpg

Command line access is simple: Setup:

$ cobbler import --name=RHEL5 --mirror=/mnt/dvd

$ cobbler import --name=Centos5 --path=rsync://foo

Create and edit distros:

$ cobbler distro edit --name=RHEL5-i386 --kopts="noapic x=y z=4"

Define some roles for your systems to fill:

$ cobbler profile edit --name=RHEL5-i386 --

kickstart=/path/to/template.ks --ksmeta="somevar=1 othervar=2"

$ cobbler profile copy --name=RHEL5-i386 --newname=webservers

Also help manage updates as they relate to installation and post-

installation:

$ cobbler repo add --name=f10-updates --mirror=http://foo

$ cobbler reposync

$ cobbler profile edit --name=desktops --repos="f10-updates"

Page 20: Build Automation 101

Puppet

http://www.wallpaperstop.com/wallpapers/cartoon-wallpapers/cartoon-puppet-wallpaper-1680x1050-0074.jpg

Page 21: Build Automation 101

Puppet

http://www.wallpaperstop.com/wallpapers/cartoon-wallpapers/cartoon-puppet-wallpaper-1680x1050-0074.jpg

$ info puppet

Puppet is a tool designed to manage the

configuration of Unix-like and Microsoft Windows

systems declaratively. In the Puppet manifests,

the user describes system resource and resource

state either in Puppet or Ruby DSL (domain-

specific language).

$

Page 22: Build Automation 101

Puppet

http://www.wallpaperstop.com/wallpapers/cartoon-wallpapers/cartoon-puppet-wallpaper-1680x1050-0074.jpg

class ssh{

package { "openssh-server":

ensure => latest,

}

file { "/etc/ssh/sshd_config":

owner => root,

group => root,

mode => 644,

source => "puppet:///ssh/sshd_config",

}

service { ssh:

ensure => running,

hasrestart => true,

subscribe => File["/etc/ssh/sshd_config"],

}

Page 23: Build Automation 101

Marionette Collective

Page 24: Build Automation 101

Marionette Collective

$ info mcollective

MCollective is a framework to build server

orchestration or parallel job execution systems.

It enables real-time discovery of network

resources and can select which resources to

affect based on configuration data from leading

systems management platforms, including Puppet.).

$

Page 25: Build Automation 101

Marionette Collective

Detect all live nodes on the network

$ mc-ping

chidori.uncommonsense.local time=47.59 ms

byakugan.uncommonsense.local time=80.71 ms

mokuton.uncommonsense.local time=80.94 ms

rinnegan.uncommonsense.local time=84.10 ms

amaterasu.uncommonsense.local time=86.92 ms

$

Page 26: Build Automation 101

Geppetto

Page 27: Build Automation 101

Questions and a Call to Action

Lets make things suck just a little bit less!Lets make things suck just a little bit less!Lets make things suck just a little bit less!Lets make things suck just a little bit less!

Page 28: Build Automation 101

Questions and a Call to Action

Lets make things suck just a little bit less!Lets make things suck just a little bit less!Lets make things suck just a little bit less!Lets make things suck just a little bit less!$ info svn

Apache Subversion is a software versioning and a

revision control system. Developers use

Subversion to maintain current and historical

versions of files such as source code, web pages,

and documentation.

$

Page 29: Build Automation 101

Questions and a Call to Action

Lets make things suck just a little bit less!Lets make things suck just a little bit less!Lets make things suck just a little bit less!Lets make things suck just a little bit less!

Who changed what, when and why

[actionjack@rasengan manifests]# svn log nodes.pp

------------------------------------------------------------------------

r5 | crazybob | 2011-05-24 12:19:10 +0100 (Tue, 24 May 2011) | 1 line

Feature #24 - User accounts cleaned up and Crazy Bobs account added

------------------------------------------------------------------------

r4 | madmonkey | 2011-05-24 09:34:28 +0100 (Tue, 24 May 2011) | 1 line

Feature #22 - Disabling developer access

------------------------------------------------------------------------

r3 | actionjack | 2011-05-23 12:21:32 +0100 (Mon, 23 May 2011) | 1 line

Feature #1 - Initial commit of puppet code

------------------------------------------------------------------------

[actionjack@rasengan manifests]#

Page 30: Build Automation 101
Page 31: Build Automation 101

$ info redmine

Redmine is a free and open source, web-based

project management and bug-tracking tool. It

includes calendar and Gantt charts to aid visual

representation of projects and their deadlines.

It supports multiple projects. Redmine provides

integrated project management features, issue

tracking, and support for multiple version

control options.

$

Page 32: Build Automation 101
Page 33: Build Automation 101
Page 34: Build Automation 101

$ info jenkins

Jenkins provides continuous integration services

for software development, primarily in the Java

programming language. It supports SCM tools

including CVS, Subversion, Git and Clearcase and

can execute Apache Ant and Apache Maven based

projects, as well as arbitrary shell scripts and

Windows batch commands.

$

Page 35: Build Automation 101
Page 36: Build Automation 101

$ info cucumber

Cucumber lets software development teams describe

how software should behave in plain text. The

text is written in a business-readable domain-

specific language and serves as documentation,

automated tests and development-aid - all rolled

into one format.

$

Page 37: Build Automation 101
Page 38: Build Automation 101

Red Hat Package Manager

Page 39: Build Automation 101

Red Hat Package Manager

$ info rpm

RPM Package Manager (RPM) is a package management

system. The name RPM variously refers to the .rpm

file format, files in this format, software

packaged in such files, and the package manager

itself. RPM was intended primarily for GNU/Linux

distributions; the file format is the baseline

package format of the Linux Standard Base.

$

Page 40: Build Automation 101

Red Hat Package Manager

Name: foo

Summary: The foo package does foo

Version: 1.0

Release: 1

License: GPL

Group: Applications/Internet

URL: http://www.example.org/

Source0 : foo-1.0.tar.gz

Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root

%description

This package performs the foo operation.

%setup -q

%install

mkdir -p %{buildroot}/%{_datadir}/%{name}

cp -p foo.spec %{buildroot}/%{_datadir}/%{name}

%clean

rm -fr %{buildroot}

%files

%defattr(-,root,root)

%{_datadir}/%{name}

%changelog

* Mon Jun 16 2003 Some One <[email protected]>

- fixed the broken frobber (#86434)

Page 41: Build Automation 101

Futures

Page 42: Build Automation 101

Vagrant

$ info vagrant

Vagrant is a tool for building and

distributing virtualized development

environments.

By providing automated creation and

provisioning of virtual machines using

Oracle’s VirtualBox, Vagrant provides

the tools to create and configure

lightweight, reproducible, and portable

virtual environments that can be run on

development workstations and laptops.

$

Page 43: Build Automation 101

Vagrant

Creating a multi-vm environment on your laptop

Vagrant::Config.run do |config|

config.vm.define :proxy do |web_config|

web_config.vm.box = "proxy"

web_config.vm.forward_port("https", 443, 443)

end

config.vm.define :tomcat do |web_config|

web_config.vm.box = "tomcat"

web_config.vm.forward_port("http", 8080, 8080)

end

config.vm.define :db do |db_config|

db_config.vm.box = "db"

db_config.vm.forward_port("db", 3306, 3306)

end

end

Page 44: Build Automation 101
Page 45: Build Automation 101

$ info katello

Katello helps you take control of your software and

your systems in an easy-to-use and scalable manner.

Katello can pull in content from remote repositories,

local directories and ISOs. You can then organize that

content into repositories that are easily searchable,

filtered, manipulated and controlled in a locked-down

container called an Environment.

Katello integrates the open-source projects Pulp,

Candlepin, and Foreman with a modern Rails front end

and a Python CLI to make it easier than ever to manage

your systems and content the way you do business.

$

Page 46: Build Automation 101
Page 47: Build Automation 101

$ info katello

Liquibase is a database-independent library for tracking,

managing and applying database changes. It is built on a

simple premise: All database changes are stored in a human

readable yet trackable form and checked into source control.

Liquibase Supports:

• Extensibility

• Merging changes from multiple developers

• Code branches

• Multiple Databases

• Managing production data as well as various test datasets

• Cluster-safe database upgrades

• Automated updates or generation of SQL scripts that can be

approved and applied by a DBA

• Update rollbacks

• Database ”diff“s

• Generating starting change logs from existing databases

• Generating database change documentation

$

Page 48: Build Automation 101

What can you do to

make your deploys go

through quicker?

Page 49: Build Automation 101
Page 50: Build Automation 101
Page 51: Build Automation 101
Page 52: Build Automation 101
Page 53: Build Automation 101
Page 54: Build Automation 101

Subversion Branches

Page 55: Build Automation 101

Subversion Branches

• Provide URLs to complete code Provide URLs to complete code Provide URLs to complete code Provide URLs to complete code branches that need to be deployed branches that need to be deployed branches that need to be deployed branches that need to be deployed e.g. web site assetse.g. web site assetse.g. web site assetse.g. web site assets

Page 56: Build Automation 101

Subversion Branches

• Provide URLs to complete code Provide URLs to complete code Provide URLs to complete code Provide URLs to complete code branches that need to be deployed branches that need to be deployed branches that need to be deployed branches that need to be deployed e.g. web site assetse.g. web site assetse.g. web site assetse.g. web site assets

• Hint: If the code that is part of an Hint: If the code that is part of an Hint: If the code that is part of an Hint: If the code that is part of an asset resides in two separate branches asset resides in two separate branches asset resides in two separate branches asset resides in two separate branches in subversion, use in subversion, use in subversion, use in subversion, use svn:externalssvn:externalssvn:externalssvn:externals to to to to pull in all the code assets don’t try to pull in all the code assets don’t try to pull in all the code assets don’t try to pull in all the code assets don’t try to manually merge manually merge manually merge manually merge or maintain them or maintain them or maintain them or maintain them separately.separately.separately.separately.

Page 57: Build Automation 101
Page 58: Build Automation 101
Page 59: Build Automation 101
Page 60: Build Automation 101
Page 61: Build Automation 101
Page 62: Build Automation 101

Externalize your Configuration

Page 63: Build Automation 101

Externalize your Configuration

Page 64: Build Automation 101

Externalize your Configuration

Page 65: Build Automation 101

Externalize your Configuration

Page 66: Build Automation 101

Externalize your Configuration

Page 67: Build Automation 101

Questions

Page 68: Build Automation 101

Links• http://www.infrastructures.org

• http://puppetlabs.com

• http://www.redhat.com

• http://www.centos.org

• https://fedorahosted.org/cobbler

• http://puppetlabs.com/mcollective/introduction

• https://github.com/cloudsmith/geppetto

• http://subversion.apache.org

• http://www.redmine.org

• http://www.redmine.org/projects/redmine/wiki/PluginKanban

• http://jenkins-ci.org

• http://cukes.info

• http://auxesis.github.com/cucumber-nagios

• http://www.rpm.org

• http://vagrantup.com

• http://katello.org

• http://www.pulpproject.org

• http://www.candlepinproject.org

• http://www.theforeman.org

• http://www.liquibase.org


Recommended