Travis vs Circle vs Jenkins

Bulgaria PHP 2016

building stuff

Photo by Michael Himbeault on Flickr

Copyright Sybren Stuvel and licensed for reuse under this Creative Commons License.

http://www.l2jserver.com/forum/viewtopic.php?t=31413

http://www.l2jserver.com/forum/viewtopic.php?t=31413

http://www.l2jserver.com/forum/viewtopic.php?t=31413

http://www.l2jserver.com/forum/viewtopic.php?t=31413

http://www.l2jserver.com/forum/viewtopic.php?t=31413

BE BETTER

  • wanted less frustrating environment
  • find bugs when I introduce them
  • started writing tests
  • got to run them now
  • make others run them too

Automation

  • feature as a list of smaller changes
  • push changes often
  • easy to merge in (avoiding big merges)
  • pull changes often

CONTINUOUS INTEGRATION

  • changes ready to merge in
  • tests verified all is ok
  • merge it to master
  • create a build artifact
  • it's deployable when ever we want

CONTINUOUS DELIVERY

  • changes on master waiting to be deployed
  • bothers while working on other things
  • merge storms 
  • just ship it!

CONTINUOUS DEPLOYMENT

Any questions ?

MIro svrtan

  • developer in TicketSwap
  • ZgPHP founder & organizer
  • WebCamp Zagreb co-founder
  • @msvrtan

Jenkins CI

Circle CI

Travis CI

Which one TO pick?

We don't wanna do ops

  • no ops person/team
  • no resources?
  • we rent stuff
  • we outsource infrastructure
  • not our core business

We don't wanna do ops

WE NEED TO KEEP IT HOME

  • own infrastructure/servers
  • have ops person/team?
  • must be behind FW
  • or just paranoid

WE NEED TO KEEP IT HOME

Jenkins

  • open source CI server
  • easy to install
    • setup <1hour
  • will need some plugins

but...

enterprise on-premise 

jump on quickly

  • small company/team/solo dev
  • code is on a private github repo
  • painless dive into world of automation
  • just wanna check "continuous *"

jump on quickly

Setup Circle ci

  • registration takes <1min
    • uses Github OAuth 
  • adding new project <1min
    • 3 clicks

Add circle.yml

Circle CI

pricing

  • private projects
    • 1 container free
    • $50 per container/month
  • public projects
    • 4 containers free
    • $50 per container/month

Multiple versions

  • test same code using multiple language versions
  • or different databases
  • or ...

Multiple versions

We have our own orm

  • need to test it against multiple versions of PHP
  • and different databases

Setup TRAVIS ci

  • registration takes <1min
    • uses Github OAuth 
  • adding new project <1min

.travis.yml

JOB page

Travis ci

pricing

  • private projects
    • 100 builds free
    • $129 for 2 concurent jobs
    • $249 for 5 concurent jobs
    • $489 for 10 concurent jobs
  • public projects
    • 4 concurent jobs free

Travis ci

public vs private repos

  • separate web sites
  • waiting queue time on private < public

Customizable JOBS

  • multiple jobs inside one build
  • each prepared differently
    • code quality check
    • browser tests

CUSTOMIZABLE JOBS

Customizable Builds

  • multiple builds on each push
  • or in pipeline
    • when X finishes, start Y

Customizable Builds

PARALLELIZE TESTS

  • tests take lot of time
  • automatic 'sharding' across nodes

PARALLELIZE TESTS

source code management support

Works with github?

Works with BITBUCKET?

Works with GITLAB?

Works with basic git repo?

Works with *anything* you can throw at it?

Quick feedback on critical + long tests

  • not critical but nice to have tests
  • take a long time
  • testing 3rd party
  • slow browser tests
  • we want quick feedback loop

Quick feedback on critical + long tests

  • separate them 
  • run
    • critical on each push
    • nice to have from time to time

Quick feedback on critical+ long tests

Any questions on this part?

or 'Still no questions?'

Clean builds vs performance

  • clean build: no artifacts from previous runs

Clean build

  • start each build from scratch
  • takes time to setup
    • dependencies
    • data
  • they offer caching of dependencies

Dirty builds

  • just continues where last one stopped
  • reuses stuff from previous runs
  • no need to install library again (composer,npm,..)
  • can save lot of time on each build
  • dirty data/files
  • problems with paralelization
  • watchout and clean it before/after build

Just continous delivery

- 1 click style

  • we can create a build from master now
  • save it somewhere
  • lets deploy it from phone using 1 button

Just continous delivery

- 1 click style

Just continous delivery

- slack style

Just continous delivery

- slack style

Continuos deployment

  • we can create a build from master now
  • save it somewhere
  • lets just deploy it when tests are green

Continuos deployment

Debug build

  • instead of sending new commits with fixes
  • lets ssh into the build 
  • save logs/artfacts

Debug build

  • it's your server :)

Debug build

  • debug in beta (add it to .travis.yml where you want a break point)
  • add AWS S3 bucket for logs/artifacts

Debug build

  • enable ssh
  • access to logs/artifacts directly

saas warnings

  • dependencies change
  • you might need newer version of X
  • your app doesn't work with newer version of Y
  • they don't announce all changes in advance

saas warnings

  • shared resource
  • variations in built times

saas warnings

  • you might need some ops knowledge for complicated scenarios

saas - the good parts

  • they take care of underlying infrastructure
  • scale X times on demand
  • they notify you when other stuff is not working properly
    • github down or webhooks not working
    • amazon/heroku unavailable

self hosted - good parts

  • your own hardware
    • buy killer CPUs/memory
  • each job/build can have more then 1 CPU
  • distribute work across slave servers

questions?

Thank you

Miro Svrtan

@msvrtan

we are hiring!

https://legacy.joind.in/talk/view/18978

Jenkins vs Circle vs Travis - BGPHP16

By Miro Svrtan

Jenkins vs Circle vs Travis - BGPHP16

Bulgaria PHP 2016 October 8th 2016

  • 2,834