SlideShare a Scribd company logo
Continuous Integration and Automated
Deployments for Symfony-based projects
Symfony 2 under control
PHP Minsk User Group
INTRODUCTION
2
Max Romanovsky
maxromanovsky.com
max.romanovsky@gmail.com
Maxim_Romanovsky@epam.com
Twitter, LinkedIn, SensioLabs Connect,
MoiKrug: maxromanovsky
Who am I
3
Continuous integration (CI) is the practice, in
software engineering, of merging all
developer working copies with a shared
mainline several times a day.
http://en.wikipedia.org/wiki/Continuous_integr
ation
http://www.martinfowler.com/articles/continuo
usIntegration.html
What is Continuous Integration?
4
• Improve quality of application
• Understand current situation on project
• Automate your checklists & verifications
• Notify different people on different events
– Build broken? – Developers
– New build deployed to QA? – QA engineers
– New build deployed to UAT/Production? –
Customers
How could it help you?
5
Dependencies
• Composer
• Platform
packages
• Phar
• Pear
• Pecl
Build
• Phing
• phpqatools.org
Continuous
Integration
• Jenkins CI
• Additional PHP-
related & general
plugins
• Git
Deployment
• Package with
vendors
• Capifony
• Doctrine
Migrations
Our proposal for Symfony-based projects
6
DEPENDENCIES
7
Manages 3rd party
dependencies
required at runtime*
• Bundles
• PHP libraries
• JS/CSS libraries
• *Phpunit for hphpa
8
Composer
getcomposer.org
Checklist
• stability
• lib-*, ext-*
• install vs update
• require
• version masks
• Keep composer.phar
under VCS
• Satis for private
packages
9
Composer
github.com/composer/satis
lib-*, ext-*: goo.gl/Z8dFal
Phar
• Only for CLI libraries used for development and build
• Composer, php-cs-fixer
Pear
• Build tools
• Phing, phpunit*, phpqatools
Pecl
• For PHP extensions missing in platform packages
Platform packages (apt, yum, ports)
• Use it for all purposes if you can (PHP, extensions etc.)
Other tools
10
What to update?
• Composer dependencies
• PHARs
• PEARs
• PECLs
• Platform packages
Keep in mind
• Update at the beginning of the
iteration
• Read changelogs
• Subscribe to news feeds
• Use * as Composer dependency
version to receive all updates
• Not for Symfony itself 
Dev
QA
Staging
• Performance testing
• Check logs
Production
11
Don’t forget about updates!
BUILD
12
Ant
• From Java world
• XML declarative config
• Can run tasks in parallel
• No PHP-specific tasks
• Could be extended (Java)
• IDE support
Phing
• Written in PHP
• Ant config syntax
• All tasks by default are running
in the single PHP process
• Could be extended (PHP)
• IDE support
Pake
• Written in PHP
• Not so popular
• PHP-based config
• github.com/indeyets/pake/wiki
Build tools
13
build-symfony-
ci.xml
• Default workflow
build.xml
• Overwrites for current
project
build.properties.dist
• Default configuration
build.properties
• Project configuration
14
Phing
phing.info
Target
• A set of tasks
• Could depend
on other targets
• phing
<target_name>
Task
• Action
executed as a
part of target
• Custom tasks
can be
implemented
Types
• Reference
• FileSet
• Property
• Other
• FileList
• Filters
Phing Terminology
15
build
• for dev
environment
• outputs to
the console
build-ci
• for CI
environment
• outputs to
XML files
package
• generates
artifacts for
deployment
• tar.gz
archive
• SQL
schema
dump
deploy
• deploys
tar.gz
archive to
the
environment
Main Phing Targets
16
Special clean
prepare
build-tools-self-update
Composer-
specific
composer-validate
dependencies-install
dependencies-list-updates update –dry-run
symfony-security-checker security.sensiolabs.org
Phing Targets (1/6)
17
General phplint
php -l
phploc
pdepend
charts
phpmd
+ custom config
phpcs/phpcs-js
+ custom config (PSR-1&2, no
var_dump(). console.log() etc)
phpcpd
Phing Targets (2/6)
18
General apidoc
PHPDoc
projectdoc
rst2html
phpunit
via exec
phpcb
PHP_CodeBrowser UI
php-cs-fixer
hphpa
HipHop static analysis
No target for KPHP yet 
Phing Targets (3/6)
19
Symfony-
specific
copy-configs-ci parameters.yml for CI
cache:warmup app/cache is removed
during build
twig:lint for Bundles and
app/Resources
assets:install
assetic:dump YUICompressor, Google
Closure Compressor,
lessphp
Phing Targets (4/6)
20
Symfony-
specific
doctrine:database:drop
doctrine:database:create
doctrine:migrations:migrate
doctrine:fixtures:load
doctrine:schema:validate
doctrine:schema:dump –
dump-sql
for DDL schema
artifact
Phing Targets (5/6)
21
Package package-version version.txt
package-db-schema schema.sql
package-archive
Deployment deploy-maintenance- enable/disable
deploy-backup-db
deploy-clear-doctrine-cache Only if not in APC
deploy-cleanup-old-releases
deploy-artifact artifact name provided via CLI
argument
Phing Targets (6/6)
22
CONTINUOUS
INTEGRATION
23
CruiseControl
• +PHP Under
Control
TeamCity
• Commercial
Travis CI
• SaaS
Scrutinizer CI
• SaaS
• PHP-oriented
Jenkins CI
• ex-Hudson CI
CI servers
24
• Open-source
• Enterprise
• Lot of plugins
• PHP Template from Sebastian
Bergmann
• IDE Integration
• RESTful API
25
Jenkins CI overview
jenkins-ci.org
• No comments git
• green & red signs for buildsgreenballs
• parameterized builds
parameterized-
trigger
• git tag selector for builds
• disable internal tagging!
git-parameter
• copy artifact from one job to
anothercopyartifact
• sends emails on successful builds
• useful for deployment jobs
email-ext
26
Jenkins Plugins (common)
goo.gl/IZ2gKE
phing
• phpcs
• hphpacheckstyle
• phpcpddry
• php_dependjdepend
• phploc using CSV filesplot
• phpmdpmd
• aggregates info from phpcs, hphpa,
phpmd, phpcpdviolations
• phpunitxunit
• HTML artifactshtmlpublisher
27
Jenkins Plugins (PHP-specific)
jenkins-php.org
Master
• Bleeding edge
• For completed features
Feature
branch
• Merge to master on completion
• After code review
• Developer executes phing build at least before code review
Tag
• Stable version from master
Bugfix &
develop?
• Sprint branch
• Master branch
• Merge feature branches to sprint branch
• Jenkins job for sprint branch
Git workflow
28
• Builds specific branch (master)
• Features are verified after merge
build-<branchname>
• Parameterized
• Produces .tar.gz artifact from specific
Git tag
build-package-tag
Jenkins Jobs for build
29
• Produces .tar.gz artifact from latest revision of branch
• Deploys to QA
• Not recommended to have more than one such job
(issues with migrations)
• Workaround: multiple QA or complete DB purge on deploy
deploy-qa-<branchname>
• Deploys specific package from build-package-tag to
specified environment
• Ability to enable/disable maintenance mode and error
message
• Email after deployment
deploy-package-tag
Jenkins Jobs for deployment
30
Deployed .tar.gz archive
• <tag>.<build#>
• v0.0.3.26
• <branchname>-<build#>-<revision>-SNAPSHOT
• master-12-7c041a90366ce9d958760094c763d809ffbc629e-
SNAPSHOT
Previous deployed version
DB dump before deployment
Doctrine Migrations info
DB schema
Jenkins Jobs for deployment. Artifacts
31
DEPLOYMENT
32
Capistrano
• from Ruby world
Capifony
• Based on
Capistrano
Shell script
• VCS update
• Rsync
Phar
• Don’t use WebPhar
• Silex does not use
it anymore
Zend Server
package
• No support for
vanilla PHP
PaaS
• AWS Elastic
Beanstalk
• PagodaBox
Deployment tools
33
Based on Capistrano
• Supports Capistrano plugins
Symfony 1&2 deployment
Multistage
• qa, staging, uat, production
Maintenance mode
Clustered environments
34
Capifony
capifony.org
Directories
• releases/
• current/ (symlink)
• shared/
Shared
• app/config/parameters.yml
• app/cache
• app/logs
• web/uploads
Shared files & dirs are
symlink’ed
Shared files & dirs are
not shared across
nodes
Directory structure for Capistrano projects
35
`-- /var/www/my-app.com
|-- current → /var/www/my-app.com/releases/20100512131539
|-- releases
| `-- 20100512131539
| `-- 20100509150741
| `-- 20100509145325
`-- shared
|-- web
| `-- uploads
|-- log
`-- config
`-- databases.yml
Directory structure example
36
All you need is package
• capistrano-deploy-strategy-archive
Github not available?
• Goodbye, vendors!
Decreases deployment time
• Lot of vendors
• Slow internet connection
Reproducible
• You know what you deploy
• You can deploy exactly the same package to multiple
environments
Deployment via SCM vs package
37
.tar.gz
Optimized
autoloader
Contains only
necessary
dirs & files
assets:install assetic:dump
version.txt &
db-
schema.sql
Packaging with Phing
38
DBDeploy Liquibase
Doctrine
Migrations
Doctrine
Fixtures
Database Migrations
39
User
• Triggers job on Jenkins CI
• Choose options (env, maintenance mode)
Jenkins
• Executes single phing target with additional
command-line arguments
Phing
• Executes several Capifony commands
according to command-line arguments
Capifony
• Performs actions on remote machines
Capifony & Jenkins CI
40
Enables Maintenance mode
• maintenance.html in webroot
Backups DB
Clears Doctrine cache
• Not for APC cache
Downloads previous deploy metadata
• package version
• Doctrine Migrations info
Deploys tar.gz archive
Capifony & Phing (1/2)
41
Restarts services
• php-fpm or Apache
• Doctrine APC cache is cleared
Symfony-specific tasks
• copy app/config/parameters.yml
• doctrine:migrations:migrate
• cache:warmup
Disables Maintenance mode
Performs cleanup for old releases
Capifony & Phing (2/2)
42
Semi-
automatical
• from
deployment
server
• usually CI
server
Enable
Maintenance
• manually via
phing
Manually backup
for analysis
• DB
• current version
• Doctrine
Migrations
status
• codebase
Rollback (1/2)
43
Switch to
previous release
• Manually via
capifony CLI
• Recover DB
• Rollback
Doctrine
Migrations
• Restore DB
dump
• Custom
Additional tasks
• Restore web
server config
• Restart service
• cache:warmup
Disable
Maintenance
• Manually via
phing
Rollback (2/2)
44
Write rollback guide
• Step-by-step
• Verify it periodically
Enable monitoring on prod
• Zabbix
• Munin
• New Relic
• Pinba
• Graylog2
Rollback tips
45
SUMMARY
46
• Currently not available online 
• Planning to release in 1-2 months on
GitHub
Where to download?
47
Deployment
•Cronjob / CLI script handling
•Web server (Apache, nginx)
config manipulations
•Ext- and lib- dependency
verification via Composer
What is not implemented yet
48
Questions?

More Related Content

What's hot (20)

Ci For The Web 2.0 Guy Or Gal
Ci For The Web 2.0 Guy Or GalCi For The Web 2.0 Guy Or Gal
Ci For The Web 2.0 Guy Or Gal
Chad Woolley
 
Perlbrew
PerlbrewPerlbrew
Perlbrew
Kang-min Liu
 
(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines
Steffen Gebert
 
7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users
Jules Pierre-Louis
 
Jenkins days workshop pipelines - Eric Long
Jenkins days workshop  pipelines - Eric LongJenkins days workshop  pipelines - Eric Long
Jenkins days workshop pipelines - Eric Long
ericlongtx
 
Drone CI/CD Platform
Drone CI/CD PlatformDrone CI/CD Platform
Drone CI/CD Platform
Bo-Yi Wu
 
Docker - Demo on PHP Application deployment
Docker - Demo on PHP Application deployment Docker - Demo on PHP Application deployment
Docker - Demo on PHP Application deployment
Arun prasath
 
7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users
Jules Pierre-Louis
 
Pragmatic Monolith-First, easy to decompose, clean architecture
Pragmatic Monolith-First, easy to decompose, clean architecturePragmatic Monolith-First, easy to decompose, clean architecture
Pragmatic Monolith-First, easy to decompose, clean architecture
Piotr Pelczar
 
sed.pdf
sed.pdfsed.pdf
sed.pdf
MaenAlWedyan
 
An Open-Source Chef Cookbook CI/CD Implementation Using Jenkins Pipelines
An Open-Source Chef Cookbook CI/CD Implementation Using Jenkins PipelinesAn Open-Source Chef Cookbook CI/CD Implementation Using Jenkins Pipelines
An Open-Source Chef Cookbook CI/CD Implementation Using Jenkins Pipelines
Steffen Gebert
 
PHP and FastCGI Performance Optimizations
PHP and FastCGI Performance OptimizationsPHP and FastCGI Performance Optimizations
PHP and FastCGI Performance Optimizations
Alessandro Pilotti
 
Codecoon - A technical Case Study
Codecoon - A technical Case StudyCodecoon - A technical Case Study
Codecoon - A technical Case Study
Michael Lihs
 
Docker 導入:障礙與對策
Docker 導入:障礙與對策Docker 導入:障礙與對策
Docker 導入:障礙與對策
William Yeh
 
Scalable Cloud-Native Masterless Puppet, with PuppetDB and Bolt, Craig Watson...
Scalable Cloud-Native Masterless Puppet, with PuppetDB and Bolt, Craig Watson...Scalable Cloud-Native Masterless Puppet, with PuppetDB and Bolt, Craig Watson...
Scalable Cloud-Native Masterless Puppet, with PuppetDB and Bolt, Craig Watson...
Puppet
 
Test-Driven Infrastructure with Chef
Test-Driven Infrastructure with ChefTest-Driven Infrastructure with Chef
Test-Driven Infrastructure with Chef
Michael Lihs
 
"Wix Serverless from inside", Mykola Borozdin
"Wix Serverless from inside", Mykola Borozdin"Wix Serverless from inside", Mykola Borozdin
"Wix Serverless from inside", Mykola Borozdin
Fwdays
 
PHP Dependency Management with Composer
PHP Dependency Management with ComposerPHP Dependency Management with Composer
PHP Dependency Management with Composer
Adam Englander
 
Conan a C/C++ Package Manager
Conan a C/C++ Package ManagerConan a C/C++ Package Manager
Conan a C/C++ Package Manager
Uilian Ries
 
perlbrew yapcasia 2010
perlbrew yapcasia 2010perlbrew yapcasia 2010
perlbrew yapcasia 2010
Kang-min Liu
 
Ci For The Web 2.0 Guy Or Gal
Ci For The Web 2.0 Guy Or GalCi For The Web 2.0 Guy Or Gal
Ci For The Web 2.0 Guy Or Gal
Chad Woolley
 
(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines(Declarative) Jenkins Pipelines
(Declarative) Jenkins Pipelines
Steffen Gebert
 
7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users
Jules Pierre-Louis
 
Jenkins days workshop pipelines - Eric Long
Jenkins days workshop  pipelines - Eric LongJenkins days workshop  pipelines - Eric Long
Jenkins days workshop pipelines - Eric Long
ericlongtx
 
Drone CI/CD Platform
Drone CI/CD PlatformDrone CI/CD Platform
Drone CI/CD Platform
Bo-Yi Wu
 
Docker - Demo on PHP Application deployment
Docker - Demo on PHP Application deployment Docker - Demo on PHP Application deployment
Docker - Demo on PHP Application deployment
Arun prasath
 
7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users
Jules Pierre-Louis
 
Pragmatic Monolith-First, easy to decompose, clean architecture
Pragmatic Monolith-First, easy to decompose, clean architecturePragmatic Monolith-First, easy to decompose, clean architecture
Pragmatic Monolith-First, easy to decompose, clean architecture
Piotr Pelczar
 
An Open-Source Chef Cookbook CI/CD Implementation Using Jenkins Pipelines
An Open-Source Chef Cookbook CI/CD Implementation Using Jenkins PipelinesAn Open-Source Chef Cookbook CI/CD Implementation Using Jenkins Pipelines
An Open-Source Chef Cookbook CI/CD Implementation Using Jenkins Pipelines
Steffen Gebert
 
PHP and FastCGI Performance Optimizations
PHP and FastCGI Performance OptimizationsPHP and FastCGI Performance Optimizations
PHP and FastCGI Performance Optimizations
Alessandro Pilotti
 
Codecoon - A technical Case Study
Codecoon - A technical Case StudyCodecoon - A technical Case Study
Codecoon - A technical Case Study
Michael Lihs
 
Docker 導入:障礙與對策
Docker 導入:障礙與對策Docker 導入:障礙與對策
Docker 導入:障礙與對策
William Yeh
 
Scalable Cloud-Native Masterless Puppet, with PuppetDB and Bolt, Craig Watson...
Scalable Cloud-Native Masterless Puppet, with PuppetDB and Bolt, Craig Watson...Scalable Cloud-Native Masterless Puppet, with PuppetDB and Bolt, Craig Watson...
Scalable Cloud-Native Masterless Puppet, with PuppetDB and Bolt, Craig Watson...
Puppet
 
Test-Driven Infrastructure with Chef
Test-Driven Infrastructure with ChefTest-Driven Infrastructure with Chef
Test-Driven Infrastructure with Chef
Michael Lihs
 
"Wix Serverless from inside", Mykola Borozdin
"Wix Serverless from inside", Mykola Borozdin"Wix Serverless from inside", Mykola Borozdin
"Wix Serverless from inside", Mykola Borozdin
Fwdays
 
PHP Dependency Management with Composer
PHP Dependency Management with ComposerPHP Dependency Management with Composer
PHP Dependency Management with Composer
Adam Englander
 
Conan a C/C++ Package Manager
Conan a C/C++ Package ManagerConan a C/C++ Package Manager
Conan a C/C++ Package Manager
Uilian Ries
 
perlbrew yapcasia 2010
perlbrew yapcasia 2010perlbrew yapcasia 2010
perlbrew yapcasia 2010
Kang-min Liu
 

Viewers also liked (20)

Intégration Continue PHP avec Jenkins CI
Intégration Continue PHP avec Jenkins CIIntégration Continue PHP avec Jenkins CI
Intégration Continue PHP avec Jenkins CI
Hugo Hamon
 
Building and deploying PHP applications with Phing
Building and deploying PHP applications with PhingBuilding and deploying PHP applications with Phing
Building and deploying PHP applications with Phing
Michiel Rook
 
BDD con Behat y Mink en Symfony2
BDD con Behat y Mink en Symfony2BDD con Behat y Mink en Symfony2
BDD con Behat y Mink en Symfony2
Carlos Granados
 
The Art of Doctrine Migrations
The Art of Doctrine MigrationsThe Art of Doctrine Migrations
The Art of Doctrine Migrations
Ryan Weaver
 
CRC cards / Minsk PHP MeetUp #8
CRC cards / Minsk PHP MeetUp #8CRC cards / Minsk PHP MeetUp #8
CRC cards / Minsk PHP MeetUp #8
Alexander Nemanov
 
SymfonyCon Berlin 2016 Jenkins Deployment Pipelines
SymfonyCon Berlin 2016 Jenkins Deployment PipelinesSymfonyCon Berlin 2016 Jenkins Deployment Pipelines
SymfonyCon Berlin 2016 Jenkins Deployment Pipelines
cpsitgmbh
 
Introduction à l'intégration continue en PHP
Introduction à l'intégration continue en PHPIntroduction à l'intégration continue en PHP
Introduction à l'intégration continue en PHP
Eric Hogue
 
Держим руку на пульсе проекта. Мониторинг PHP-приложений
Держим руку на пульсе проекта. Мониторинг PHP-приложенийДержим руку на пульсе проекта. Мониторинг PHP-приложений
Держим руку на пульсе проекта. Мониторинг PHP-приложений
Max Romanovsky
 
Dependency injection with Symfony 2
Dependency injection with Symfony 2Dependency injection with Symfony 2
Dependency injection with Symfony 2
cammanderson
 
Building and Deploying PHP Apps Using phing
Building and Deploying PHP Apps Using phingBuilding and Deploying PHP Apps Using phing
Building and Deploying PHP Apps Using phing
Mihail Irintchev
 
Juc boston2014.pptx
Juc boston2014.pptxJuc boston2014.pptx
Juc boston2014.pptx
Brandon Mueller
 
Build & deploy PHP application (intro level)
Build & deploy PHP application (intro level)Build & deploy PHP application (intro level)
Build & deploy PHP application (intro level)
Anton Babenko
 
Dependency Injection
Dependency InjectionDependency Injection
Dependency Injection
Fabien Potencier
 
Deploying PHP applications with Phing
Deploying PHP applications with PhingDeploying PHP applications with Phing
Deploying PHP applications with Phing
Michiel Rook
 
Microservice architecture
Microservice architectureMicroservice architecture
Microservice architecture
Xavier Fornés Arrabal
 
Acceptance & Functional Testing with Codeception - SunshinePHP 2016
Acceptance & Functional Testing with Codeception - SunshinePHP 2016Acceptance & Functional Testing with Codeception - SunshinePHP 2016
Acceptance & Functional Testing with Codeception - SunshinePHP 2016
Joe Ferguson
 
Dependency injection - the right way
Dependency injection - the right wayDependency injection - the right way
Dependency injection - the right way
Thibaud Desodt
 
Symfony in microservice architecture
Symfony in microservice architectureSymfony in microservice architecture
Symfony in microservice architecture
Daniele D'Angeli
 
Impact Analysis - LoopConf
Impact Analysis - LoopConfImpact Analysis - LoopConf
Impact Analysis - LoopConf
Chris Lema
 
Dependency injection in PHP 5.3/5.4
Dependency injection in PHP 5.3/5.4Dependency injection in PHP 5.3/5.4
Dependency injection in PHP 5.3/5.4
Fabien Potencier
 
Intégration Continue PHP avec Jenkins CI
Intégration Continue PHP avec Jenkins CIIntégration Continue PHP avec Jenkins CI
Intégration Continue PHP avec Jenkins CI
Hugo Hamon
 
Building and deploying PHP applications with Phing
Building and deploying PHP applications with PhingBuilding and deploying PHP applications with Phing
Building and deploying PHP applications with Phing
Michiel Rook
 
BDD con Behat y Mink en Symfony2
BDD con Behat y Mink en Symfony2BDD con Behat y Mink en Symfony2
BDD con Behat y Mink en Symfony2
Carlos Granados
 
The Art of Doctrine Migrations
The Art of Doctrine MigrationsThe Art of Doctrine Migrations
The Art of Doctrine Migrations
Ryan Weaver
 
CRC cards / Minsk PHP MeetUp #8
CRC cards / Minsk PHP MeetUp #8CRC cards / Minsk PHP MeetUp #8
CRC cards / Minsk PHP MeetUp #8
Alexander Nemanov
 
SymfonyCon Berlin 2016 Jenkins Deployment Pipelines
SymfonyCon Berlin 2016 Jenkins Deployment PipelinesSymfonyCon Berlin 2016 Jenkins Deployment Pipelines
SymfonyCon Berlin 2016 Jenkins Deployment Pipelines
cpsitgmbh
 
Introduction à l'intégration continue en PHP
Introduction à l'intégration continue en PHPIntroduction à l'intégration continue en PHP
Introduction à l'intégration continue en PHP
Eric Hogue
 
Держим руку на пульсе проекта. Мониторинг PHP-приложений
Держим руку на пульсе проекта. Мониторинг PHP-приложенийДержим руку на пульсе проекта. Мониторинг PHP-приложений
Держим руку на пульсе проекта. Мониторинг PHP-приложений
Max Romanovsky
 
Dependency injection with Symfony 2
Dependency injection with Symfony 2Dependency injection with Symfony 2
Dependency injection with Symfony 2
cammanderson
 
Building and Deploying PHP Apps Using phing
Building and Deploying PHP Apps Using phingBuilding and Deploying PHP Apps Using phing
Building and Deploying PHP Apps Using phing
Mihail Irintchev
 
Build & deploy PHP application (intro level)
Build & deploy PHP application (intro level)Build & deploy PHP application (intro level)
Build & deploy PHP application (intro level)
Anton Babenko
 
Deploying PHP applications with Phing
Deploying PHP applications with PhingDeploying PHP applications with Phing
Deploying PHP applications with Phing
Michiel Rook
 
Acceptance & Functional Testing with Codeception - SunshinePHP 2016
Acceptance & Functional Testing with Codeception - SunshinePHP 2016Acceptance & Functional Testing with Codeception - SunshinePHP 2016
Acceptance & Functional Testing with Codeception - SunshinePHP 2016
Joe Ferguson
 
Dependency injection - the right way
Dependency injection - the right wayDependency injection - the right way
Dependency injection - the right way
Thibaud Desodt
 
Symfony in microservice architecture
Symfony in microservice architectureSymfony in microservice architecture
Symfony in microservice architecture
Daniele D'Angeli
 
Impact Analysis - LoopConf
Impact Analysis - LoopConfImpact Analysis - LoopConf
Impact Analysis - LoopConf
Chris Lema
 
Dependency injection in PHP 5.3/5.4
Dependency injection in PHP 5.3/5.4Dependency injection in PHP 5.3/5.4
Dependency injection in PHP 5.3/5.4
Fabien Potencier
 
Ad

Similar to Symfony under control. Continuous Integration and Automated Deployments in Symfony-based projects (20)

Continous delivery with Jenkins and Chef
Continous delivery with Jenkins and ChefContinous delivery with Jenkins and Chef
Continous delivery with Jenkins and Chef
defrag2
 
Continuous Integration at Mollie
Continuous Integration at MollieContinuous Integration at Mollie
Continuous Integration at Mollie
willemstuursma
 
CI
CICI
CI
Patrick Mizer
 
Building and Deploying PHP apps with Phing
Building and Deploying PHP apps with PhingBuilding and Deploying PHP apps with Phing
Building and Deploying PHP apps with Phing
Michiel Rook
 
Deploying software at Scale
Deploying software at ScaleDeploying software at Scale
Deploying software at Scale
Kris Buytaert
 
Pipeline as code for your infrastructure as Code
Pipeline as code for your infrastructure as CodePipeline as code for your infrastructure as Code
Pipeline as code for your infrastructure as Code
Kris Buytaert
 
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Fabrice Bernhard
 
Supermondays: Jenkins CI lightning talk
Supermondays: Jenkins CI lightning talkSupermondays: Jenkins CI lightning talk
Supermondays: Jenkins CI lightning talk
Michael Peacock
 
One commit, one release. Continuously delivering a Symfony project.
One commit, one release. Continuously delivering a Symfony project.One commit, one release. Continuously delivering a Symfony project.
One commit, one release. Continuously delivering a Symfony project.
Javier López
 
Makefiles in 2020 — Why they still matter
Makefiles in 2020 — Why they still matterMakefiles in 2020 — Why they still matter
Makefiles in 2020 — Why they still matter
Simon Brüggen
 
Automated Deployment Pipeline using Jenkins, Puppet, Mcollective and AWS
Automated Deployment Pipeline using Jenkins, Puppet, Mcollective and AWSAutomated Deployment Pipeline using Jenkins, Puppet, Mcollective and AWS
Automated Deployment Pipeline using Jenkins, Puppet, Mcollective and AWS
Bamdad Dashtban
 
Continous Delivering a PHP application
Continous Delivering a PHP applicationContinous Delivering a PHP application
Continous Delivering a PHP application
Javier López
 
An introduction to Phing the PHP build system
An introduction to Phing the PHP build systemAn introduction to Phing the PHP build system
An introduction to Phing the PHP build system
Jeremy Coates
 
The Continuous PHP Pipeline
The Continuous PHP PipelineThe Continuous PHP Pipeline
The Continuous PHP Pipeline
Michelangelo van Dam
 
Continuous Delivery - Automate & Build Better Software with Travis CI
Continuous Delivery - Automate & Build Better Software with Travis CIContinuous Delivery - Automate & Build Better Software with Travis CI
Continuous Delivery - Automate & Build Better Software with Travis CI
wajrcs
 
Continuos Integration @Knetminer
Continuos Integration @KnetminerContinuos Integration @Knetminer
Continuos Integration @Knetminer
Rothamsted Research, UK
 
Continuous Delivery of (y)our infrastructure.
Continuous Delivery of (y)our infrastructure.Continuous Delivery of (y)our infrastructure.
Continuous Delivery of (y)our infrastructure.
Kris Buytaert
 
Symfony Live NYC 2014 - Rock Solid Deployment of Symfony Apps
Symfony Live NYC 2014 -  Rock Solid Deployment of Symfony AppsSymfony Live NYC 2014 -  Rock Solid Deployment of Symfony Apps
Symfony Live NYC 2014 - Rock Solid Deployment of Symfony Apps
Pablo Godel
 
Devops
DevopsDevops
Devops
JyothirmaiG4
 
Write php deploy everywhere tek11
Write php deploy everywhere   tek11Write php deploy everywhere   tek11
Write php deploy everywhere tek11
Michelangelo van Dam
 
Continous delivery with Jenkins and Chef
Continous delivery with Jenkins and ChefContinous delivery with Jenkins and Chef
Continous delivery with Jenkins and Chef
defrag2
 
Continuous Integration at Mollie
Continuous Integration at MollieContinuous Integration at Mollie
Continuous Integration at Mollie
willemstuursma
 
Building and Deploying PHP apps with Phing
Building and Deploying PHP apps with PhingBuilding and Deploying PHP apps with Phing
Building and Deploying PHP apps with Phing
Michiel Rook
 
Deploying software at Scale
Deploying software at ScaleDeploying software at Scale
Deploying software at Scale
Kris Buytaert
 
Pipeline as code for your infrastructure as Code
Pipeline as code for your infrastructure as CodePipeline as code for your infrastructure as Code
Pipeline as code for your infrastructure as Code
Kris Buytaert
 
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Adopt DevOps philosophy on your Symfony projects (Symfony Live 2011)
Fabrice Bernhard
 
Supermondays: Jenkins CI lightning talk
Supermondays: Jenkins CI lightning talkSupermondays: Jenkins CI lightning talk
Supermondays: Jenkins CI lightning talk
Michael Peacock
 
One commit, one release. Continuously delivering a Symfony project.
One commit, one release. Continuously delivering a Symfony project.One commit, one release. Continuously delivering a Symfony project.
One commit, one release. Continuously delivering a Symfony project.
Javier López
 
Makefiles in 2020 — Why they still matter
Makefiles in 2020 — Why they still matterMakefiles in 2020 — Why they still matter
Makefiles in 2020 — Why they still matter
Simon Brüggen
 
Automated Deployment Pipeline using Jenkins, Puppet, Mcollective and AWS
Automated Deployment Pipeline using Jenkins, Puppet, Mcollective and AWSAutomated Deployment Pipeline using Jenkins, Puppet, Mcollective and AWS
Automated Deployment Pipeline using Jenkins, Puppet, Mcollective and AWS
Bamdad Dashtban
 
Continous Delivering a PHP application
Continous Delivering a PHP applicationContinous Delivering a PHP application
Continous Delivering a PHP application
Javier López
 
An introduction to Phing the PHP build system
An introduction to Phing the PHP build systemAn introduction to Phing the PHP build system
An introduction to Phing the PHP build system
Jeremy Coates
 
Continuous Delivery - Automate & Build Better Software with Travis CI
Continuous Delivery - Automate & Build Better Software with Travis CIContinuous Delivery - Automate & Build Better Software with Travis CI
Continuous Delivery - Automate & Build Better Software with Travis CI
wajrcs
 
Continuous Delivery of (y)our infrastructure.
Continuous Delivery of (y)our infrastructure.Continuous Delivery of (y)our infrastructure.
Continuous Delivery of (y)our infrastructure.
Kris Buytaert
 
Symfony Live NYC 2014 - Rock Solid Deployment of Symfony Apps
Symfony Live NYC 2014 -  Rock Solid Deployment of Symfony AppsSymfony Live NYC 2014 -  Rock Solid Deployment of Symfony Apps
Symfony Live NYC 2014 - Rock Solid Deployment of Symfony Apps
Pablo Godel
 
Ad

Recently uploaded (20)

FME for Climate Data: Turning Big Data into Actionable Insights
FME for Climate Data: Turning Big Data into Actionable InsightsFME for Climate Data: Turning Big Data into Actionable Insights
FME for Climate Data: Turning Big Data into Actionable Insights
Safe Software
 
Top 11 Fleet Management Software Providers in 2025 (2).pdf
Top 11 Fleet Management Software Providers in 2025 (2).pdfTop 11 Fleet Management Software Providers in 2025 (2).pdf
Top 11 Fleet Management Software Providers in 2025 (2).pdf
Trackobit
 
How to purchase, license and subscribe to Microsoft Azure_PDF.pdf
How to purchase, license and subscribe to Microsoft Azure_PDF.pdfHow to purchase, license and subscribe to Microsoft Azure_PDF.pdf
How to purchase, license and subscribe to Microsoft Azure_PDF.pdf
victordsane
 
How Insurance Policy Administration Streamlines Policy Lifecycle for Agile Op...
How Insurance Policy Administration Streamlines Policy Lifecycle for Agile Op...How Insurance Policy Administration Streamlines Policy Lifecycle for Agile Op...
How Insurance Policy Administration Streamlines Policy Lifecycle for Agile Op...
Insurance Tech Services
 
Revolutionize Your Insurance Workflow with Claims Management Software
Revolutionize Your Insurance Workflow with Claims Management SoftwareRevolutionize Your Insurance Workflow with Claims Management Software
Revolutionize Your Insurance Workflow with Claims Management Software
Insurance Tech Services
 
Scaling FME Flow on Demand with Kubernetes: A Case Study At Cadac Group SaaS ...
Scaling FME Flow on Demand with Kubernetes: A Case Study At Cadac Group SaaS ...Scaling FME Flow on Demand with Kubernetes: A Case Study At Cadac Group SaaS ...
Scaling FME Flow on Demand with Kubernetes: A Case Study At Cadac Group SaaS ...
Safe Software
 
Rebuilding Cadabra Studio: AI as Our Core Foundation
Rebuilding Cadabra Studio: AI as Our Core FoundationRebuilding Cadabra Studio: AI as Our Core Foundation
Rebuilding Cadabra Studio: AI as Our Core Foundation
Cadabra Studio
 
IMAGE CLASSIFICATION USING CONVOLUTIONAL NEURAL NETWORK.P.pptx
IMAGE CLASSIFICATION USING CONVOLUTIONAL NEURAL NETWORK.P.pptxIMAGE CLASSIFICATION USING CONVOLUTIONAL NEURAL NETWORK.P.pptx
IMAGE CLASSIFICATION USING CONVOLUTIONAL NEURAL NETWORK.P.pptx
usmanch7829
 
FME as an Orchestration Tool - Peak of Data & AI 2025
FME as an Orchestration Tool - Peak of Data & AI 2025FME as an Orchestration Tool - Peak of Data & AI 2025
FME as an Orchestration Tool - Peak of Data & AI 2025
Safe Software
 
Best Inbound Call Tracking Software for Small Businesses
Best Inbound Call Tracking Software for Small BusinessesBest Inbound Call Tracking Software for Small Businesses
Best Inbound Call Tracking Software for Small Businesses
TheTelephony
 
AI and Deep Learning with NVIDIA Technologies
AI and Deep Learning with NVIDIA TechnologiesAI and Deep Learning with NVIDIA Technologies
AI and Deep Learning with NVIDIA Technologies
SandeepKS52
 
Design by Contract - Building Robust Software with Contract-First Development
Design by Contract - Building Robust Software with Contract-First DevelopmentDesign by Contract - Building Robust Software with Contract-First Development
Design by Contract - Building Robust Software with Contract-First Development
Par-Tec S.p.A.
 
Artificial Intelligence Applications Across Industries
Artificial Intelligence Applications Across IndustriesArtificial Intelligence Applications Across Industries
Artificial Intelligence Applications Across Industries
SandeepKS52
 
14 Years of Developing nCine - An Open Source 2D Game Framework
14 Years of Developing nCine - An Open Source 2D Game Framework14 Years of Developing nCine - An Open Source 2D Game Framework
14 Years of Developing nCine - An Open Source 2D Game Framework
Angelo Theodorou
 
Build enterprise-ready applications using skills you already have!
Build enterprise-ready applications using skills you already have!Build enterprise-ready applications using skills you already have!
Build enterprise-ready applications using skills you already have!
PhilMeredith3
 
DevOps for AI: running LLMs in production with Kubernetes and KubeFlow
DevOps for AI: running LLMs in production with Kubernetes and KubeFlowDevOps for AI: running LLMs in production with Kubernetes and KubeFlow
DevOps for AI: running LLMs in production with Kubernetes and KubeFlow
Aarno Aukia
 
Generative Artificial Intelligence and its Applications
Generative Artificial Intelligence and its ApplicationsGenerative Artificial Intelligence and its Applications
Generative Artificial Intelligence and its Applications
SandeepKS52
 
How to Generate Financial Statements in QuickBooks Like a Pro (1).pdf
How to Generate Financial Statements in QuickBooks Like a Pro (1).pdfHow to Generate Financial Statements in QuickBooks Like a Pro (1).pdf
How to Generate Financial Statements in QuickBooks Like a Pro (1).pdf
QuickBooks Training
 
iOS Developer Resume 2025 | Pramod Kumar
iOS Developer Resume 2025 | Pramod KumariOS Developer Resume 2025 | Pramod Kumar
iOS Developer Resume 2025 | Pramod Kumar
Pramod Kumar
 
Key AI Technologies Used by Indian Artificial Intelligence Companies
Key AI Technologies Used by Indian Artificial Intelligence CompaniesKey AI Technologies Used by Indian Artificial Intelligence Companies
Key AI Technologies Used by Indian Artificial Intelligence Companies
Mypcot Infotech
 
FME for Climate Data: Turning Big Data into Actionable Insights
FME for Climate Data: Turning Big Data into Actionable InsightsFME for Climate Data: Turning Big Data into Actionable Insights
FME for Climate Data: Turning Big Data into Actionable Insights
Safe Software
 
Top 11 Fleet Management Software Providers in 2025 (2).pdf
Top 11 Fleet Management Software Providers in 2025 (2).pdfTop 11 Fleet Management Software Providers in 2025 (2).pdf
Top 11 Fleet Management Software Providers in 2025 (2).pdf
Trackobit
 
How to purchase, license and subscribe to Microsoft Azure_PDF.pdf
How to purchase, license and subscribe to Microsoft Azure_PDF.pdfHow to purchase, license and subscribe to Microsoft Azure_PDF.pdf
How to purchase, license and subscribe to Microsoft Azure_PDF.pdf
victordsane
 
How Insurance Policy Administration Streamlines Policy Lifecycle for Agile Op...
How Insurance Policy Administration Streamlines Policy Lifecycle for Agile Op...How Insurance Policy Administration Streamlines Policy Lifecycle for Agile Op...
How Insurance Policy Administration Streamlines Policy Lifecycle for Agile Op...
Insurance Tech Services
 
Revolutionize Your Insurance Workflow with Claims Management Software
Revolutionize Your Insurance Workflow with Claims Management SoftwareRevolutionize Your Insurance Workflow with Claims Management Software
Revolutionize Your Insurance Workflow with Claims Management Software
Insurance Tech Services
 
Scaling FME Flow on Demand with Kubernetes: A Case Study At Cadac Group SaaS ...
Scaling FME Flow on Demand with Kubernetes: A Case Study At Cadac Group SaaS ...Scaling FME Flow on Demand with Kubernetes: A Case Study At Cadac Group SaaS ...
Scaling FME Flow on Demand with Kubernetes: A Case Study At Cadac Group SaaS ...
Safe Software
 
Rebuilding Cadabra Studio: AI as Our Core Foundation
Rebuilding Cadabra Studio: AI as Our Core FoundationRebuilding Cadabra Studio: AI as Our Core Foundation
Rebuilding Cadabra Studio: AI as Our Core Foundation
Cadabra Studio
 
IMAGE CLASSIFICATION USING CONVOLUTIONAL NEURAL NETWORK.P.pptx
IMAGE CLASSIFICATION USING CONVOLUTIONAL NEURAL NETWORK.P.pptxIMAGE CLASSIFICATION USING CONVOLUTIONAL NEURAL NETWORK.P.pptx
IMAGE CLASSIFICATION USING CONVOLUTIONAL NEURAL NETWORK.P.pptx
usmanch7829
 
FME as an Orchestration Tool - Peak of Data & AI 2025
FME as an Orchestration Tool - Peak of Data & AI 2025FME as an Orchestration Tool - Peak of Data & AI 2025
FME as an Orchestration Tool - Peak of Data & AI 2025
Safe Software
 
Best Inbound Call Tracking Software for Small Businesses
Best Inbound Call Tracking Software for Small BusinessesBest Inbound Call Tracking Software for Small Businesses
Best Inbound Call Tracking Software for Small Businesses
TheTelephony
 
AI and Deep Learning with NVIDIA Technologies
AI and Deep Learning with NVIDIA TechnologiesAI and Deep Learning with NVIDIA Technologies
AI and Deep Learning with NVIDIA Technologies
SandeepKS52
 
Design by Contract - Building Robust Software with Contract-First Development
Design by Contract - Building Robust Software with Contract-First DevelopmentDesign by Contract - Building Robust Software with Contract-First Development
Design by Contract - Building Robust Software with Contract-First Development
Par-Tec S.p.A.
 
Artificial Intelligence Applications Across Industries
Artificial Intelligence Applications Across IndustriesArtificial Intelligence Applications Across Industries
Artificial Intelligence Applications Across Industries
SandeepKS52
 
14 Years of Developing nCine - An Open Source 2D Game Framework
14 Years of Developing nCine - An Open Source 2D Game Framework14 Years of Developing nCine - An Open Source 2D Game Framework
14 Years of Developing nCine - An Open Source 2D Game Framework
Angelo Theodorou
 
Build enterprise-ready applications using skills you already have!
Build enterprise-ready applications using skills you already have!Build enterprise-ready applications using skills you already have!
Build enterprise-ready applications using skills you already have!
PhilMeredith3
 
DevOps for AI: running LLMs in production with Kubernetes and KubeFlow
DevOps for AI: running LLMs in production with Kubernetes and KubeFlowDevOps for AI: running LLMs in production with Kubernetes and KubeFlow
DevOps for AI: running LLMs in production with Kubernetes and KubeFlow
Aarno Aukia
 
Generative Artificial Intelligence and its Applications
Generative Artificial Intelligence and its ApplicationsGenerative Artificial Intelligence and its Applications
Generative Artificial Intelligence and its Applications
SandeepKS52
 
How to Generate Financial Statements in QuickBooks Like a Pro (1).pdf
How to Generate Financial Statements in QuickBooks Like a Pro (1).pdfHow to Generate Financial Statements in QuickBooks Like a Pro (1).pdf
How to Generate Financial Statements in QuickBooks Like a Pro (1).pdf
QuickBooks Training
 
iOS Developer Resume 2025 | Pramod Kumar
iOS Developer Resume 2025 | Pramod KumariOS Developer Resume 2025 | Pramod Kumar
iOS Developer Resume 2025 | Pramod Kumar
Pramod Kumar
 
Key AI Technologies Used by Indian Artificial Intelligence Companies
Key AI Technologies Used by Indian Artificial Intelligence CompaniesKey AI Technologies Used by Indian Artificial Intelligence Companies
Key AI Technologies Used by Indian Artificial Intelligence Companies
Mypcot Infotech
 

Symfony under control. Continuous Integration and Automated Deployments in Symfony-based projects

  • 1. Continuous Integration and Automated Deployments for Symfony-based projects Symfony 2 under control PHP Minsk User Group
  • 4. Continuous integration (CI) is the practice, in software engineering, of merging all developer working copies with a shared mainline several times a day. http://en.wikipedia.org/wiki/Continuous_integr ation http://www.martinfowler.com/articles/continuo usIntegration.html What is Continuous Integration? 4
  • 5. • Improve quality of application • Understand current situation on project • Automate your checklists & verifications • Notify different people on different events – Build broken? – Developers – New build deployed to QA? – QA engineers – New build deployed to UAT/Production? – Customers How could it help you? 5
  • 6. Dependencies • Composer • Platform packages • Phar • Pear • Pecl Build • Phing • phpqatools.org Continuous Integration • Jenkins CI • Additional PHP- related & general plugins • Git Deployment • Package with vendors • Capifony • Doctrine Migrations Our proposal for Symfony-based projects 6
  • 8. Manages 3rd party dependencies required at runtime* • Bundles • PHP libraries • JS/CSS libraries • *Phpunit for hphpa 8 Composer getcomposer.org
  • 9. Checklist • stability • lib-*, ext-* • install vs update • require • version masks • Keep composer.phar under VCS • Satis for private packages 9 Composer github.com/composer/satis lib-*, ext-*: goo.gl/Z8dFal
  • 10. Phar • Only for CLI libraries used for development and build • Composer, php-cs-fixer Pear • Build tools • Phing, phpunit*, phpqatools Pecl • For PHP extensions missing in platform packages Platform packages (apt, yum, ports) • Use it for all purposes if you can (PHP, extensions etc.) Other tools 10
  • 11. What to update? • Composer dependencies • PHARs • PEARs • PECLs • Platform packages Keep in mind • Update at the beginning of the iteration • Read changelogs • Subscribe to news feeds • Use * as Composer dependency version to receive all updates • Not for Symfony itself  Dev QA Staging • Performance testing • Check logs Production 11 Don’t forget about updates!
  • 13. Ant • From Java world • XML declarative config • Can run tasks in parallel • No PHP-specific tasks • Could be extended (Java) • IDE support Phing • Written in PHP • Ant config syntax • All tasks by default are running in the single PHP process • Could be extended (PHP) • IDE support Pake • Written in PHP • Not so popular • PHP-based config • github.com/indeyets/pake/wiki Build tools 13
  • 14. build-symfony- ci.xml • Default workflow build.xml • Overwrites for current project build.properties.dist • Default configuration build.properties • Project configuration 14 Phing phing.info
  • 15. Target • A set of tasks • Could depend on other targets • phing <target_name> Task • Action executed as a part of target • Custom tasks can be implemented Types • Reference • FileSet • Property • Other • FileList • Filters Phing Terminology 15
  • 16. build • for dev environment • outputs to the console build-ci • for CI environment • outputs to XML files package • generates artifacts for deployment • tar.gz archive • SQL schema dump deploy • deploys tar.gz archive to the environment Main Phing Targets 16
  • 18. General phplint php -l phploc pdepend charts phpmd + custom config phpcs/phpcs-js + custom config (PSR-1&2, no var_dump(). console.log() etc) phpcpd Phing Targets (2/6) 18
  • 19. General apidoc PHPDoc projectdoc rst2html phpunit via exec phpcb PHP_CodeBrowser UI php-cs-fixer hphpa HipHop static analysis No target for KPHP yet  Phing Targets (3/6) 19
  • 20. Symfony- specific copy-configs-ci parameters.yml for CI cache:warmup app/cache is removed during build twig:lint for Bundles and app/Resources assets:install assetic:dump YUICompressor, Google Closure Compressor, lessphp Phing Targets (4/6) 20
  • 22. Package package-version version.txt package-db-schema schema.sql package-archive Deployment deploy-maintenance- enable/disable deploy-backup-db deploy-clear-doctrine-cache Only if not in APC deploy-cleanup-old-releases deploy-artifact artifact name provided via CLI argument Phing Targets (6/6) 22
  • 24. CruiseControl • +PHP Under Control TeamCity • Commercial Travis CI • SaaS Scrutinizer CI • SaaS • PHP-oriented Jenkins CI • ex-Hudson CI CI servers 24
  • 25. • Open-source • Enterprise • Lot of plugins • PHP Template from Sebastian Bergmann • IDE Integration • RESTful API 25 Jenkins CI overview jenkins-ci.org
  • 26. • No comments git • green & red signs for buildsgreenballs • parameterized builds parameterized- trigger • git tag selector for builds • disable internal tagging! git-parameter • copy artifact from one job to anothercopyartifact • sends emails on successful builds • useful for deployment jobs email-ext 26 Jenkins Plugins (common) goo.gl/IZ2gKE
  • 27. phing • phpcs • hphpacheckstyle • phpcpddry • php_dependjdepend • phploc using CSV filesplot • phpmdpmd • aggregates info from phpcs, hphpa, phpmd, phpcpdviolations • phpunitxunit • HTML artifactshtmlpublisher 27 Jenkins Plugins (PHP-specific) jenkins-php.org
  • 28. Master • Bleeding edge • For completed features Feature branch • Merge to master on completion • After code review • Developer executes phing build at least before code review Tag • Stable version from master Bugfix & develop? • Sprint branch • Master branch • Merge feature branches to sprint branch • Jenkins job for sprint branch Git workflow 28
  • 29. • Builds specific branch (master) • Features are verified after merge build-<branchname> • Parameterized • Produces .tar.gz artifact from specific Git tag build-package-tag Jenkins Jobs for build 29
  • 30. • Produces .tar.gz artifact from latest revision of branch • Deploys to QA • Not recommended to have more than one such job (issues with migrations) • Workaround: multiple QA or complete DB purge on deploy deploy-qa-<branchname> • Deploys specific package from build-package-tag to specified environment • Ability to enable/disable maintenance mode and error message • Email after deployment deploy-package-tag Jenkins Jobs for deployment 30
  • 31. Deployed .tar.gz archive • <tag>.<build#> • v0.0.3.26 • <branchname>-<build#>-<revision>-SNAPSHOT • master-12-7c041a90366ce9d958760094c763d809ffbc629e- SNAPSHOT Previous deployed version DB dump before deployment Doctrine Migrations info DB schema Jenkins Jobs for deployment. Artifacts 31
  • 33. Capistrano • from Ruby world Capifony • Based on Capistrano Shell script • VCS update • Rsync Phar • Don’t use WebPhar • Silex does not use it anymore Zend Server package • No support for vanilla PHP PaaS • AWS Elastic Beanstalk • PagodaBox Deployment tools 33
  • 34. Based on Capistrano • Supports Capistrano plugins Symfony 1&2 deployment Multistage • qa, staging, uat, production Maintenance mode Clustered environments 34 Capifony capifony.org
  • 35. Directories • releases/ • current/ (symlink) • shared/ Shared • app/config/parameters.yml • app/cache • app/logs • web/uploads Shared files & dirs are symlink’ed Shared files & dirs are not shared across nodes Directory structure for Capistrano projects 35
  • 36. `-- /var/www/my-app.com |-- current → /var/www/my-app.com/releases/20100512131539 |-- releases | `-- 20100512131539 | `-- 20100509150741 | `-- 20100509145325 `-- shared |-- web | `-- uploads |-- log `-- config `-- databases.yml Directory structure example 36
  • 37. All you need is package • capistrano-deploy-strategy-archive Github not available? • Goodbye, vendors! Decreases deployment time • Lot of vendors • Slow internet connection Reproducible • You know what you deploy • You can deploy exactly the same package to multiple environments Deployment via SCM vs package 37
  • 38. .tar.gz Optimized autoloader Contains only necessary dirs & files assets:install assetic:dump version.txt & db- schema.sql Packaging with Phing 38
  • 40. User • Triggers job on Jenkins CI • Choose options (env, maintenance mode) Jenkins • Executes single phing target with additional command-line arguments Phing • Executes several Capifony commands according to command-line arguments Capifony • Performs actions on remote machines Capifony & Jenkins CI 40
  • 41. Enables Maintenance mode • maintenance.html in webroot Backups DB Clears Doctrine cache • Not for APC cache Downloads previous deploy metadata • package version • Doctrine Migrations info Deploys tar.gz archive Capifony & Phing (1/2) 41
  • 42. Restarts services • php-fpm or Apache • Doctrine APC cache is cleared Symfony-specific tasks • copy app/config/parameters.yml • doctrine:migrations:migrate • cache:warmup Disables Maintenance mode Performs cleanup for old releases Capifony & Phing (2/2) 42
  • 43. Semi- automatical • from deployment server • usually CI server Enable Maintenance • manually via phing Manually backup for analysis • DB • current version • Doctrine Migrations status • codebase Rollback (1/2) 43
  • 44. Switch to previous release • Manually via capifony CLI • Recover DB • Rollback Doctrine Migrations • Restore DB dump • Custom Additional tasks • Restore web server config • Restart service • cache:warmup Disable Maintenance • Manually via phing Rollback (2/2) 44
  • 45. Write rollback guide • Step-by-step • Verify it periodically Enable monitoring on prod • Zabbix • Munin • New Relic • Pinba • Graylog2 Rollback tips 45
  • 47. • Currently not available online  • Planning to release in 1-2 months on GitHub Where to download? 47
  • 48. Deployment •Cronjob / CLI script handling •Web server (Apache, nginx) config manipulations •Ext- and lib- dependency verification via Composer What is not implemented yet 48