Build Automation 101


Published on

Build Automation 101:
A Presentation on the current tools my Web Operations team uses to build and deploy code.

Build Automation 101

  1. 1. Agenda
  2. 2. Fast and Easy Deploys• From Heath Robinson
  3. 3. Fast and Easy Deploys• From Heath Robinson to Production Line
  4. 4. Eliminating Configuration Drift• Once deployed a machine will inevitably drift from a known state
  5. 5. Infrastructure as Code• Synthesizing machines from a known codebase
  6. 6. Operating System Platform• Customisable• Easily automated• Packaging friendly• Free alternatives available
  7. 7.
  8. 8. $ info cobblerCobbler is a Linux installation server thatallows for rapid setup of network installationenvironments. It glues together and automatesmany associated Linux tasks so you do not have tohop between lots of various commands andapplications when rolling out new systems, and,in some cases, changing existing ones.$
  9. 9. Command line access is simple: Setup:$ cobbler import --name=RHEL5 --mirror=/mnt/dvd$ cobbler import --name=Centos5 --path=rsync://fooCreate 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=webserversAlso 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"
  10. 10. Puppet
  11. 11. Puppet $ 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). $
  12. 12. Puppet 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"], }
  13. 13. Marionette Collective
  14. 14. $ info mcollectiveMCollective is a framework to build serverorchestration or parallel job execution systems.It enables real-time discovery of networkresources and can select which resources toaffect based on configuration data from leadingsystems management platforms, including Puppet.).$ Marionette Collective
  15. 15. Detect all live nodes on the network$ mc-pingchidori.uncommonsense.local time=47.59 msbyakugan.uncommonsense.local time=80.71 msmokuton.uncommonsense.local time=80.94 msrinnegan.uncommonsense.local time=84.10 msamaterasu.uncommonsense.local time=86.92 ms$ Marionette Collective
  16. 16. Geppetto
  17. 17. Questions and a Call to ActionLets make things suck just a little bit less!
  18. 18. Questions and a Call to Action$ info svn Lets make things suck just a little bit less!Apache Subversion is a software versioning and arevision control system. Developers useSubversion to maintain current and historicalversions of files such as source code, web pages,and documentation.$
  19. 19. Questions and a Call to ActionWho changed what, when and why[actionjack@rasengan manifests]# svn log nodes.pp Lets make things suck just a little bit less!------------------------------------------------------------------------r5 | crazybob | 2011-05-24 12:19:10 +0100 (Tue, 24 May 2011) | 1 lineFeature #24 - User accounts cleaned up and Crazy Bobs account added------------------------------------------------------------------------r4 | madmonkey | 2011-05-24 09:34:28 +0100 (Tue, 24 May 2011) | 1 lineFeature #22 - Disabling developer access------------------------------------------------------------------------r3 | actionjack | 2011-05-23 12:21:32 +0100 (Mon, 23 May 2011) | 1 lineFeature #1 - Initial commit of puppet code------------------------------------------------------------------------[actionjack@rasengan manifests]#
  20. 20. $ info redmineRedmine is a free and open source, web-basedproject management and bug-tracking tool. Itincludes calendar and Gantt charts to aid visualrepresentation of projects and their deadlines.It supports multiple projects. Redmine providesintegrated project management features, issuetracking, and support for multiple versioncontrol options.$
  21. 21. $ info jenkinsJenkins provides continuous integration servicesfor software development, primarily in the Javaprogramming language. It supports SCM toolsincluding CVS, Subversion, Git and Clearcase andcan execute Apache Ant and Apache Maven basedprojects, as well as arbitrary shell scripts andWindows batch commands.$
  22. 22. $ info cucumberCucumber lets software development teams describehow software should behave in plain text. Thetext is written in a business-readable domain-specific language and serves as documentation,automated tests and development-aid - all rolledinto one format.$
  23. 23. Red Hat Package Manager
  24. 24. Red Hat Package Manager$ info rpmRPM Package Manager (RPM) is a package managementsystem. The name RPM variously refers to the .rpmfile format, files in this format, softwarepackaged in such files, and the package manageritself. RPM was intended primarily for GNU/Linuxdistributions; the file format is the baselinepackage format of the Linux Standard Base.$
  25. 25. Red Hat Package ManagerName: foo Summary: The foo package does foo Version: 1.0 Release: 1 License: GPL Group: Applications/Internet URL: 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 <> - fixed the broken frobber (#86434)
  26. 26. Futures
  27. 27. Vagrant$ info vagrantVagrant is a tool for building anddistributing virtualized developmentenvironments.By providing automated creation andprovisioning of virtual machines usingOracle’s VirtualBox, Vagrant providesthe tools to create and configurelightweight, reproducible, and portablevirtual environments that can be run ondevelopment workstations and laptops.$
  28. 28. VagrantCreating a multi-vm environment on your do |config| config.vm.define :proxy do |web_config| = "proxy" web_config.vm.forward_port("https", 443, 443) end config.vm.define :tomcat do |web_config| = "tomcat" web_config.vm.forward_port("http", 8080, 8080) end config.vm.define :db do |db_config| = "db" db_config.vm.forward_port("db", 3306, 3306) endend
  29. 29. $ info katelloKatello helps you take control of your software andyour 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 thatcontent into repositories that are easily searchable,filtered, manipulated and controlled in a locked-downcontainer called an Environment.Katello integrates the open-source projects Pulp,Candlepin, and Foreman with a modern Rails front endand a Python CLI to make it easier than ever to manageyour systems and content the way you do business.$
  30. 30. $ info katelloLiquibase is a database-independent library for tracking,managing and applying database changes. It is built on asimple premise: All database changes are stored in a humanreadable 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$
  31. 31. What can you do tomake yourdeploys go through quicker?
  32. 32. Subversion Branches
  33. 33. Subversion Branches• Provide URLs to complete code branches that need to be deployed e.g. web site assets
  34. 34. Subversion Branches• Provide URLs to complete code branches that need to be deployed e.g. web site assets• Hint: If the code that is part of an asset resides in two separate branches in subversion, use svn:externals to pull in all the code assets don’t try to manually merge or maintain them separately.
  35. 35. Externalize your Configuration
  36. 36. Externalize your Configuration
  37. 37. Externalize your Configuration
  38. 38. Externalize your Configuration
  39. 39. Externalize your Configuration
  40. 40. Questions
  41. 41. Links••••••••••••••••••••
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.