Hands on continouous delivery, I TAKE 2014

Post on 10-May-2015

3,062 views 1 download

Tags:

description

Tools needed to build a Continuous delivery pipeline. Most tools are generic and can be used regardless of language, some are specific for Java/JVM. http://2014.itakeunconf.com/

transcript

Hands on continuous delivery

Ioan Eugen Stan - I T.A.K.E. , Bucharest 2014

Disclaimer

This is my way of making software that runs great in production.

It’s work in progress and

adapted to the environment.

Software ‘goods’

Operating System, Firmware

Web ApplicationDeskptop/Mobile Application

Software consumprtion: versions

● Debian 7, Windows 8.1, Android 4.4.2● Firefox 24, Java 8● Wikipedia version ? - current● Facebook version ? - current● Google version ? - current

Continuous Delivery (CD) is a design practice used in software development to automate and improve the process of software delivery(Make releases boring)

http://en.wikipedia.org/wiki/File:Worksman_delivery_trike.jpg

Continuous delivery

Process

http://blog.crisp.se/2013/02/05/yassalsundman/continuous-delivery-vs-continuous-deployment

Continuous delivery diagram - Jez Humble http://continuousdelivery.com/2010/02/continuous-delivery/

Tools● distributed version control system● a build tool (project management tool)● software artifact repository● continuous integration server● many environments - test, staging,

production, etc.

Version controlWhere all the code gets refactored

● manage and track source code changes● history tracking● enable colaboration on code

What do they do?

Popular implementations

Developer Productivity Report 2013 (Zeroturnaround)

Take advantage of the VCS● use a distributed VCS (git or similar)● ‘master’ branch only for releases● ‘develop’ contains the next release ● use feature branches

A successful Git branching model by Vincent Driessen

Git branching model by Lemi Orhan Ergin

Git branching model by Lemi Orhan Ergin

Git branching model by Lemi Orhan Ergin

My advice● use profesional services like Github,

BitBucket or the like as much as posible● use the integrated code review tools they

provide● roll your own only with strong SysAdmin

team

Build (automation) tools

Generic build process

Simple build processhttp://physinfo-mac0.ulb.ac.be/divers_html/powerpc_programming_info/intro_to_ppc/ppc5_porting5.html

Some popular build automation tools

Tool Mostly used for languages

make C/C++ mostly

distcc C/C++ mostly

rake Ruby

Apache Ant Java

Apaceh Maven JVM langs, JavaScript,PHP

Gradle JVM languages, generic

sbt Scala, JVM

Grunt JavaScript

DevProd Redux (Zeroturnaround)

Maven standard build process

Build life cycle

● fixed life-cycle - disadvantage● very Java centric, but● promotes dependency management● is a standard for Artifact Repositories● used for PHP: http://www.php-maven.org/● used for JS: http://www.webjars.org/

About Maven

The software/artifact repository

What are they good for● store versions of artifacts (libraries,

resources, binaries)● eases consumption for tools/users● could be a simple FTP location/ git repos

http://wiki.netbeans.org/MavenBestPractices

Software package repositories by language

Language/purpose Repository

C++ Boost

Haskell Hackage

Java Maven

.NET NuGet

Node.js NPM

Python PyPl

R CRAN

Ruby Ruby Application Archive

http://en.wikipedia.org/wiki/Software_repository

Continuous Integration

Simple CI definition

A set of software engineering practices that speed up the delivery of software by

decreasing integration times.

In practice● build application on commit● run unit tests on commit● run integration test on commit● execute other post-build jobs

Developer Productivity Report 2013 (Zeroturnaround)

My attempt to achieve CD● keep everything in version control● standard deployment infrastructure (Debian stable VM’

s)● build a single artifact - .deb package - that builds and

starts our app● rely on Jenkins automated build● automated integration testing, via Jenkins● automated acceptance testing, via Jenkins

Demo (fingers crossed)

Conclusion

The key test is that a business sponsor could request that the current development version of the software can be deployed into production at a moment's notice - and nobody would bat an

eyelid, let alone panic.(Martin Fowler)

DZone Continuous Delivery Research 2014

About me

IT Consultant/DeveloperApache CommitterDebian Contributor

BJUG leader

http://ro.linkedin.com/in/ieugen/@ieugen222

stan.ieugen@gmail.com