Jenkins with superpowers

Post on 07-Jan-2017

932 views 0 download

Transcript of Jenkins with superpowers

JENKINS WITH SUPER POWERS

Alessandro Mazzoli am@ideato.it@alendmazz

Why I should prefer on-premise Jenkins

vs SaaS like Travis or CircleCI ?

Let’s talk about $$$

TravisCI startup plan costs 130$/monthly for 2 concurrent builds and several limits

c4.xlarge( 4 core, 8GB RAM,1Gb/s) ~ 130$/monthly

but I have to spend some time to configure Jenkins…

Let’s talk about $$$

why should I keep my CI server always ON even outside work hours??!!

here it comes on demand…

C4xlarge for 180h/720h ~ 32$

Let’s talk about $$$

but my sysadmin has to switch on/off every day??!!

lot of waste and boring things!

Let’s talk about $$$

AWS CLI + CRON JOBS!!!•20 9 * * 1-5 root/usr/local/bin/jenkins_on.sh•50 19 * * 1-5 root /usr/local/bin/jenkins_off.sh

code will be available on https://www.ideato.it/blog

Let’s talk about heterogeneity

we have heterogeneous projects…

•PHP versions(5.4, 5.5,5.6) •Elasticsearch(0.9->1.4) •NodeJS •….

with TravisCI I can easily set several PHP versions, how can I run tests for these on JenkinsCI ?

Let’s talk about heterogeneity

Let’s talk about heterogeneity

Let’s talk about heterogeneity

docker images and reusability

Let’s talk about heterogeneity

docker images and reusability

Let’s talk about heterogeneity

docker images and reusability

a possible workflow…

All the additional software(ES, mongoDB..) required should be defined in a Dockerfile, committed inside the project repository

and built on top of CI image

Jenkins job will launch “composer install”,build the image

and run tests inside the container

Our Dockerfile

for i.e we need Elasticsearch 1.4.2 & Node.js

run_tests will launch services inside the container

Our Dockerfile

run_tests will launch services and tests through Idephix inside the container

Let’s talk about performance…

but you build the Dockerfile every time?

Not really…Docker use AUFS & caching layers!!!

How do you manage the code??

git pull inside the container or

shared code through Docker Volumes??

first approach more clean and isolate…but Composer?

Composer for large project is a bottleneck with our connectivity

on c4.xlarge we have 1Gb/s…

Let’s go on Jenkins

Resuming….

1 day for Jenkins setup 1/2 day for AWS cli cronjob

~ 550€ (one time cost)

+ AWS c4.xlarge 32€ x 12=384€ = 934€

vs TravisCI Startup Plan 114€ x 12 = 1368€

Thanks for watching

Useful links: http://getidephix.com/

https://www.ideato.it/blog