travis-ci - continuos integration in the cloud for php

Post on 08-May-2015

525 Views

Category:

Technology

8 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Travis-CIContinuous integration in the cloud for PHP

Federico Lozada Mosto

@mostofreddy

@federicolozadamosto

Who makes tests?

Who makes builds?

Who uses CI server?

Who uses multiple environments?

Hi, I’m Travis CI, a hosted continuous integration service

for open-source and private projects.

What?

Continous integration

Open source

Distributed

Android C/C++ Clojure Erlang Go Groovy

Haskell Java Javascript NodeJS Objective-C

PERL PHP Phyton Ruby Scala

Services:

MySQL PostgreSQL MongoDB CouchDB

Redis Riak RabbitMQ Memcached

Cassandra Neo4j Elasticsearch

Krestel SQLite3 ZeroMQ

Notifications:

Email IRC Campfire Flowdock

HipChat Sqwiggle Slack Webhook

Deploy: Appfog Cloud66 Heroku Modulus Nodejitsu

OpenShift cloudControl CloudFoundryRubyGems AWS OpsWorks PyPI

Divshot.io Rackspace Cloud FilesNpm S3 Ninefold Engine Yard

Github Releases Custom deployment

How?

login

How does it work?

service hook

How does it work?

gi add .travis.ymlgit commit .travis.yml

git push ….

How does it work?

gi add .git commit .

git push ….

service hook

run tests / builds

fresh environments

How does it work?

.travis.yml

.travis.yml

.travis.yml

Build lifecycle

1. before_install

2. install

3. before_script

4. script

5. after_script

6. after_success or after_failure

Build status

Why?

The end goal is...

with less effort

Higher-quality code

and...

#HAPPYDAY

Extras

xdebugxmlxmlreaderXmlrpcxmlwriterxslzipzlib

[Zend Modules]Xdebug

bcmathbz2Corectypecurldatedomeregexiffileinfofilterftpgdgettexthashiconv

intljsonlibxmlmbstringmcryptmysqlmysqlimysqlndopensslpcntlpcrePDOpdo_mysqlpdo_pgsqlpdo_sqlitepgsql

PharposixreadlineReflectionsessionshmopSimpleXMLsoapsocketsSPLsqlite3standardsysvsemsysvshmtidytokenizer

VM - PHP

email recipients: - dummy@server.com on_success: [always|never|change] # default: change on_failure: [always|never|change] # default: always

irc: channels: - "chat.freenode.net#my-channel" on_success: [always|never|change] # default: always on_failure: [always|never|change] # default: always

notifications

Apc

Memcache

Memcached

Mongo

Amqp

Zmq

Xdebug

Redis

PHP extensions

before_script - echo "extension = <extension>.so" >>

~/.phpenv/versions/$(phpenv version-name)/etc/php.ini

PHP extensions

before_script - pear install <extension> - echo "extension = <extension>.so" >>

~/.phpenv/versions/$(phpenv version-name)/etc/php.ini - php -m

PHP extensions

http://yaml.travis-ci.org/

Travis lint

apt-get install !!!

before_script: - curl http://repo.varnish-cache.org/debian/GPG-key.txt | \

sudo apt-key add - - echo "deb http://repo.varnish-cache.org/ubuntu/ precise varnish-3.0" | \

sudo tee -a /etc/apt/sources.list - sudo apt-get update -qq - sudo apt-get install varnish

services

services: - mongodb - couchdb - memcached

env: - DB=mysql

before_script: - mongo mydb_test --eval 'db.addUser("travis", "test");' - if [[ "$DB" == "mysql" ]]; then mysql -e "create database IF NOT EXISTS hello_world_test;" -uroot; fi

How to skip a build

[ci skip]

Federico Lozada Mosto

@mostofreddy

@federicolozadamosto

Thanks!

top related