jenkins with superpowers

21
JENKINS WITH SUPER POWERS Alessandro Mazzoli [email protected] @alendmazz

Upload: ideato

Post on 07-Jan-2017

930 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Jenkins with superpowers

JENKINS WITH SUPER POWERS

Alessandro Mazzoli [email protected]@alendmazz

Page 2: Jenkins with superpowers

Why I should prefer on-premise Jenkins

vs SaaS like Travis or CircleCI ?

Page 3: Jenkins with superpowers

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…

Page 4: Jenkins with superpowers

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$

Page 5: Jenkins with superpowers

Let’s talk about $$$

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

lot of waste and boring things!

Page 6: Jenkins with superpowers

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

Page 7: Jenkins with superpowers

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 ?

Page 8: Jenkins with superpowers

Let’s talk about heterogeneity

Page 9: Jenkins with superpowers

Let’s talk about heterogeneity

Page 10: Jenkins with superpowers

Let’s talk about heterogeneity

docker images and reusability

Page 11: Jenkins with superpowers

Let’s talk about heterogeneity

docker images and reusability

Page 12: Jenkins with superpowers

Let’s talk about heterogeneity

docker images and reusability

Page 13: Jenkins with superpowers

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

Page 14: Jenkins with superpowers

Our Dockerfile

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

run_tests will launch services inside the container

Page 15: Jenkins with superpowers

Our Dockerfile

run_tests will launch services and tests through Idephix inside the container

Page 16: Jenkins with superpowers

Let’s talk about performance…

but you build the Dockerfile every time?

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

Page 17: Jenkins with superpowers

How do you manage the code??

git pull inside the container or

shared code through Docker Volumes??

Page 18: Jenkins with superpowers

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…

Page 19: Jenkins with superpowers

Let’s go on Jenkins

Page 20: Jenkins with superpowers

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€

Page 21: Jenkins with superpowers

Thanks for watching

Useful links: http://getidephix.com/

https://www.ideato.it/blog