Hands on continouous delivery, I TAKE 2014

37
Hands on continuous delivery Ioan Eugen Stan - I T.A.K.E. , Bucharest 2014

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 of Hands on continouous delivery, I TAKE 2014

Page 1: Hands on continouous delivery, I TAKE 2014

Hands on continuous delivery

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

Page 2: Hands on continouous delivery, I TAKE 2014

Disclaimer

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

It’s work in progress and

adapted to the environment.

Page 3: Hands on continouous delivery, I TAKE 2014

Software ‘goods’

Operating System, Firmware

Web ApplicationDeskptop/Mobile Application

Page 4: Hands on continouous delivery, I TAKE 2014

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

Page 5: Hands on continouous delivery, I TAKE 2014

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

Page 6: Hands on continouous delivery, I TAKE 2014

Process

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

Page 7: Hands on continouous delivery, I TAKE 2014

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

Page 8: Hands on continouous delivery, I TAKE 2014

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

production, etc.

Page 9: Hands on continouous delivery, I TAKE 2014

Version controlWhere all the code gets refactored

Page 10: Hands on continouous delivery, I TAKE 2014

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

What do they do?

Page 11: Hands on continouous delivery, I TAKE 2014

Popular implementations

Developer Productivity Report 2013 (Zeroturnaround)

Page 12: Hands on continouous delivery, I TAKE 2014

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

Page 13: Hands on continouous delivery, I TAKE 2014

A successful Git branching model by Vincent Driessen

Page 14: Hands on continouous delivery, I TAKE 2014

Git branching model by Lemi Orhan Ergin

Page 15: Hands on continouous delivery, I TAKE 2014

Git branching model by Lemi Orhan Ergin

Page 16: Hands on continouous delivery, I TAKE 2014

Git branching model by Lemi Orhan Ergin

Page 17: Hands on continouous delivery, I TAKE 2014

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

Page 18: Hands on continouous delivery, I TAKE 2014

Build (automation) tools

Page 19: Hands on continouous delivery, I TAKE 2014

Generic build process

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

Page 20: Hands on continouous delivery, I TAKE 2014

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

Page 21: Hands on continouous delivery, I TAKE 2014

DevProd Redux (Zeroturnaround)

Page 22: Hands on continouous delivery, I TAKE 2014

Maven standard build process

Build life cycle

Page 23: Hands on continouous delivery, I TAKE 2014

● 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

Page 24: Hands on continouous delivery, I TAKE 2014

The software/artifact repository

Page 25: Hands on continouous delivery, I TAKE 2014

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

Page 26: Hands on continouous delivery, I TAKE 2014

http://wiki.netbeans.org/MavenBestPractices

Page 27: Hands on continouous delivery, I TAKE 2014

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

Page 28: Hands on continouous delivery, I TAKE 2014

Continuous Integration

Page 29: Hands on continouous delivery, I TAKE 2014

Simple CI definition

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

decreasing integration times.

Page 30: Hands on continouous delivery, I TAKE 2014

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

Page 31: Hands on continouous delivery, I TAKE 2014

Developer Productivity Report 2013 (Zeroturnaround)

Page 32: Hands on continouous delivery, I TAKE 2014

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

Page 33: Hands on continouous delivery, I TAKE 2014

Demo (fingers crossed)

Page 34: Hands on continouous delivery, I TAKE 2014

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)

Page 35: Hands on continouous delivery, I TAKE 2014

DZone Continuous Delivery Research 2014

Page 36: Hands on continouous delivery, I TAKE 2014

About me

IT Consultant/DeveloperApache CommitterDebian Contributor

BJUG leader

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

[email protected]