Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
2 
The 
Con(nuous 
PHP 
Pipeline 
ZendCon 
2014, 
Santa 
Clara
Michelangelo 
van 
Dam 
2
Schedule 
• Development 
processes 
• Automa;on 
first 
• Con;nuous 
Integra;on 
• The 
PHP 
Pipeline 
• Do 
what 
you 
do...
Required 
knowledge 
• Working 
with 
an 
SCM 
• Unit 
tes;ng 
• Distributed 
architectures 
• Provisioning 
plaMorms 
• H...
Development 
management 
5 
https://www.flickr.com/photos/27433628@N05/2597308328
Project 
flow: 
Waterfall 
6 
Project Start 
Kick-off meeting 
Defining Approach 
Meeting Execs 
Project Initiate 
Busines...
Project 
flow: 
Scrum 
Weekly 
backlog review 
7 
Daily 
standups 
Product 
Backlog 
Acceptance 
Criteria 
Sprint 
Backlog...
Project 
flow: 
something… 
8 
Project 
Requirements 
Ad-hock 
Issues 
Task 
Assignment 
Delivery
Common: 
delivery 
9 
Weekly 
backlog review 
Daily 
standups 
Product 
Backlog 
Acceptance 
Criteria 
Sprint 
Backlog 
Pr...
Delivery 
event! 
• Off-­‐hours 
release 
planning 
• Set 
up 
a 
maintenance 
page 
• Pre-­‐release 
ac;ons 
(backups, 
s...
A 
nightmare 
11 
https://www.flickr.com/photos/bernatcg/2231649285
Automa(on 
first! 
12 
https://www.flickr.com/photos/freefoto/5982549938
Computers 
are 
great 
at 
doing 
repe((ve 
task 
very 
well 
13
Iden(fying 
the 
players 
14 
Development 
Source 
Code 
Static 
Files 
Database 
Deltas 
Platform 
Web 
Server 
Monitorin...
Infrastructure 
Infrastructure 
Bare 
Metal 
15 
Virtual 
Machines 
Cloud
PlaJorm 
Platform 
Web 
Server 
Monitoring Database 
Storage Workers Caches 
16
Automa(ng 
tools 
https://www.gnu.org/graphics/heckert_gnu.small.png 
17
Why 
automate 
plaJorm? 
• It 
should 
be 
op;mised 
to 
run 
your 
applica;on 
• Con;nuous 
updates 
and 
tweaks 
possibl...
Choose 
wisely 
19 
https://www.flickr.com/photos/keepitsurreal/6107919083
Give 
Docker 
a 
try 
• Requires 
no 
virtualisa;on 
so[ware 
• Saves 
on 
resources! 
• Allows 
to 
set 
up 
a 
distribut...
Vagrant 
up 
21 
Web 
Server 
Monitoring Database 
Storage Workers Caches
Development 
Development 
Source 
Code 
22 
Static 
Files 
Database 
Deltas
SCM 
is 
a 
must! 
23
FTP 
is 
not 
SCM!!! 
24
Commit 
and 
push 
25
Con(nuous 
Integra(on 
26 
https://www.flickr.com/photos/mabi/38307124
Most 
common 
CI 
systems 
27
Why 
CI? 
• Monitors 
con;nuously 
• Executes 
directly 
a[er 
change 
• Gives 
feedback 
• Has 
dashboards 
• Automate 
p...
CI 
takes 
care 
of 
you 
29 
Pre build steps! 
- Stop crons, queues and workers 
- Remove target from load balancer 
Buil...
The 
PHP 
Pipeline 
30 
https://www.flickr.com/photos/mmmavocado/4597397875
Priori(se 
build 
steps 
31 
Unit tests Metrics 
Provisioning 
new target 
Provisioning 
databases 
Provisioning 
workers ...
Stop 
execu(on 
at 
first 
fail 
32 
Unit tests Metrics 
Provisioning 
new target 
Provisioning 
databases 
Provisioning 
...
When 
good, 
promote 
33 
Unit tests Metrics 
Provisioning 
new target 
Provisioning 
databases 
Provisioning 
workers 
In...
Con(nuous 
Delivery 
SCM 
Commits SCM Change 
34 
Build Feedback 
Build Feedback 
Polling 
Deployment Management 
Dashboar...
Con(nuous 
Deployment 
SCM 
Commits SCM Change 
Polling 
35 
Build Feedback 
Execute Delivery 
test 
staging 
production
What’s 
the 
difference? 
Source: http://blog.crisp.se/2013/02/05/yassalsundman/continuous-delivery-vs-continuous-deployme...
Do 
what 
you 
do 
best: 
code! 
37 
https://www.flickr.com/photos/ihtatho/627226315
The 
benefit 
38
Failures 
happen 
39
Overview 
of 
our 
tools 
40
Rounding 
up 
41 
https://www.flickr.com/photos/timypenburg/5172042007
Build 
your 
own 
pipeline 
• Automate 
everything 
that’s 
not 
coding 
• Create 
repeatable, 
reliable 
processes 
• Fai...
Recommended 
reading 
43
44
joind.in/12053 
Slides will be available here, please leave feedback 
! 
If you like it, thanks! 
If you don’t, tell me ho...
Ques(ons? 
46
Thank 
you 
47 
in 2 it 
PROFESSIONAL PHP SERVICES 
Michelangelo van Dam! 
Zend Certified Engineer 
PHP Consulting - Train...
Upcoming SlideShare
Loading in …5
×

Continous PHP Pipeline - ZendCon 2014

2,128 views

Published on

You've got your tests, your metrics, your database migrations and your system provisioning automated, but how can you deploy everything with a push of a button and not be scared something goes wrong? Welcome to the continuous PHP Pipeline. In this talk I take the code, the tests, the metrics and the provisioners and show you how you can have a continuous delivery pipeline setup based on certain criteria you define upfront, your code gets automatically deployed to staging or to production with all the arbitrary tasks along with it. Never get stressed again about deployments. Make deployments as easy as committing to your repository and get home on time to enjoy your well deserved weekend.

Published in: Engineering

Continous PHP Pipeline - ZendCon 2014

  1. 1. 2 The Con(nuous PHP Pipeline ZendCon 2014, Santa Clara
  2. 2. Michelangelo van Dam 2
  3. 3. Schedule • Development processes • Automa;on first • Con;nuous Integra;on • The PHP Pipeline • Do what you do best: code • Round up 3
  4. 4. Required knowledge • Working with an SCM • Unit tes;ng • Distributed architectures • Provisioning plaMorms • Have experienced troubled releases 4
  5. 5. Development management 5 https://www.flickr.com/photos/27433628@N05/2597308328
  6. 6. Project flow: Waterfall 6 Project Start Kick-off meeting Defining Approach Meeting Execs Project Initiate Business Cases Project Controls Risk Definition Project Control Progress Monitoring Project Delivery Project finalisation Maintenance Ongoing process
  7. 7. Project flow: Scrum Weekly backlog review 7 Daily standups Product Backlog Acceptance Criteria Sprint Backlog Prototype Delivery Product Backlog Product PBroadcukclot g Backlog Sprint
  8. 8. Project flow: something… 8 Project Requirements Ad-hock Issues Task Assignment Delivery
  9. 9. Common: delivery 9 Weekly backlog review Daily standups Product Backlog Acceptance Criteria Sprint Backlog Prototype Delivery Product Backlog Product PBroadcukclot g Backlog Sprint Project Start Kick-off meeting Defining Approach Meeting Execs Project Initiate Business Cases Project Controls Risk Definition Project Control Progress Monitoring Project Delivery Project finalisation Maintenance Ongoing process Project Requirements Ad-hock Issues Task Assignment Delivery Delivery
  10. 10. Delivery event! • Off-­‐hours release planning • Set up a maintenance page • Pre-­‐release ac;ons (backups, stopping crons, …) • Release checklist -­‐> manual deployment • Post-­‐release ac;ons (crons, caches, …) • Removing maintenance page • Manually verify everything is working (old & new stuff) • If lucky, going home for the night 10
  11. 11. A nightmare 11 https://www.flickr.com/photos/bernatcg/2231649285
  12. 12. Automa(on first! 12 https://www.flickr.com/photos/freefoto/5982549938
  13. 13. Computers are great at doing repe((ve task very well 13
  14. 14. Iden(fying the players 14 Development Source Code Static Files Database Deltas Platform Web Server Monitoring Database Storage Workers Caches Infrastructure Bare Metal Virtual Machines Cloud
  15. 15. Infrastructure Infrastructure Bare Metal 15 Virtual Machines Cloud
  16. 16. PlaJorm Platform Web Server Monitoring Database Storage Workers Caches 16
  17. 17. Automa(ng tools https://www.gnu.org/graphics/heckert_gnu.small.png 17
  18. 18. Why automate plaJorm? • It should be op;mised to run your applica;on • Con;nuous updates and tweaks possible • SeXng up your architecture in a consistent way • For produc;on • For staging • For tes;ng • For development 18
  19. 19. Choose wisely 19 https://www.flickr.com/photos/keepitsurreal/6107919083
  20. 20. Give Docker a try • Requires no virtualisa;on so[ware • Saves on resources! • Allows to set up a distributed architecture • Even for development purposes • Isolates processes in a container • Helps with securing infrastructure 20
  21. 21. Vagrant up 21 Web Server Monitoring Database Storage Workers Caches
  22. 22. Development Development Source Code 22 Static Files Database Deltas
  23. 23. SCM is a must! 23
  24. 24. FTP is not SCM!!! 24
  25. 25. Commit and push 25
  26. 26. Con(nuous Integra(on 26 https://www.flickr.com/photos/mabi/38307124
  27. 27. Most common CI systems 27
  28. 28. Why CI? • Monitors con;nuously • Executes directly a[er change • Gives feedback • Has dashboards • Automate post-­‐development processes 28 https://www.flickr.com/photos/amberandclint/3266859324
  29. 29. CI takes care of you 29 Pre build steps! - Stop crons, queues and workers - Remove target from load balancer Build steps! - Check out new changes - Run unit tests - Provision target(s) - Provision databases Post build steps! - Warm up caches - Reactivate crons, queues and workers - Add target back into loadbalancer - Sent status out
  30. 30. The PHP Pipeline 30 https://www.flickr.com/photos/mmmavocado/4597397875
  31. 31. Priori(se build steps 31 Unit tests Metrics Provisioning new target Provisioning databases Provisioning workers Integration tests Promote branch CI
  32. 32. Stop execu(on at first fail 32 Unit tests Metrics Provisioning new target Provisioning databases Provisioning workers Integration tests Promote branch CI
  33. 33. When good, promote 33 Unit tests Metrics Provisioning new target Provisioning databases Provisioning workers Integration tests Promote branch CI Unit tests Metrics Provisioning new target Provisioning databases Provisioning workers Integration tests Promote branch CI
  34. 34. Con(nuous Delivery SCM Commits SCM Change 34 Build Feedback Build Feedback Polling Deployment Management Dashboard test staging production
  35. 35. Con(nuous Deployment SCM Commits SCM Change Polling 35 Build Feedback Execute Delivery test staging production
  36. 36. What’s the difference? Source: http://blog.crisp.se/2013/02/05/yassalsundman/continuous-delivery-vs-continuous-deployment 36
  37. 37. Do what you do best: code! 37 https://www.flickr.com/photos/ihtatho/627226315
  38. 38. The benefit 38
  39. 39. Failures happen 39
  40. 40. Overview of our tools 40
  41. 41. Rounding up 41 https://www.flickr.com/photos/timypenburg/5172042007
  42. 42. Build your own pipeline • Automate everything that’s not coding • Create repeatable, reliable processes • Fail as quickly as possible • If it hurts, do it more frequently • Communicate each step • Everyone is responsible! • Con;nuously improve • On your code • On your processes 42
  43. 43. Recommended reading 43
  44. 44. 44
  45. 45. joind.in/12053 Slides will be available here, please leave feedback ! If you like it, thanks! If you don’t, tell me how to improve this talk 45
  46. 46. Ques(ons? 46
  47. 47. Thank you 47 in 2 it PROFESSIONAL PHP SERVICES Michelangelo van Dam! Zend Certified Engineer PHP Consulting - Training - Quality Assurance www.in2it.be | contact@in2it.be

×