Practical PHP Deployment with Jenkins By: Adam Culp Twitter: @adamculp

Practical PHP Deployment with Jenkins ● 2 About me – PHP 5.3 Certified – Consultant at Zend Technologies – Zend Certification Advisory Board – Organizer SoFloPHP (South Florida) – Organized SunshinePHP (Miami) – Long distance (ultra) runner – Judo Black Belt Instructor

Practical PHP Deployment with Jenkins ● Fan of iteration – 3 Pretty much everything requires iteration to do well: ● Long distance running ● Judo ● Development ● Evading project managers ● Deploying!

Practical PHP Deployment with Jenkins ● 4 Dev VS Ops – Dev = Ops – Dev doesn’t like Ops – Can’t communicate – Challenges syncing

Practical PHP Deployment with Jenkins ● Continuous Delivery – Not a single app solution – Many pieces – Not covered here – 5 ● Provisioning of servers ● Integration to monitoring We will focus on:

Practical PHP Deployment with Jenkins ● 6 Continuous Integration

Practical PHP Deployment with Jenkins ● 7 Deployment – FTP works…NOT! – Many large PHP sites – Simple != solution

Practical PHP Deployment with Jenkins ● 8 5 to 7 Releases…A Day! – Not achievable with FTP – Must be automated

Practical PHP Deployment with Jenkins ● 9 Ready To Deploy! – Not after every commit – But always “ready”

Practical PHP Deployment with Jenkins ● 10 Best Practices – No holy grail here – Many dependencies ● Development team ● Application ● Size of application ● How to implement

Practical PHP Deployment with Jenkins ● 11 Architecture – Git – Jenkins – Zend Server

Practical PHP Deployment with Jenkins ● 12 Zend Server – Full PHP application stack – Supported – Consistent across OS – Automated deployment – Cluster management

Practical PHP Deployment with Jenkins ● 13 WebAPI – Restful Service – Built API first – GUI is just the front-end

Practical PHP Deployment with Jenkins ● 14 Source Control – !Github here (just in case) – Using Git

Practical PHP Deployment with Jenkins ● PHP QA Tools – 16 http://phpqatools.org ● PHPUnit ● pdepend

Practical PHP Deployment with Jenkins ● 17 Docker – Linux Containers – Versioned (“Git for servers”) – Stores delta

Practical PHP Deployment with Jenkins ● When Apps Break – 18 What’s really to blame?

Practical PHP Deployment with Jenkins ● Root Cause Analysis – – 19 What is the cause ● How to prevent ● How to fix Needs to happen fast!

Practical PHP Deployment with Jenkins ● Rollback – Within 30 seconds ● 20 Even in a cluster!

Practical PHP Deployment with Jenkins ● Demo – Using Pimcore – Jenkins ● Multiple jobs from: Checkout – Testing – Packaging – Deployment to staging – Rollback – Deploy to production (cluster) Then we’ll see the details – – 21

Practical PHP Deployment with Jenkins ● 22 Jenkins plugins – Build Pipeline Plugin – Clone Workspace SCM plugin – x CloudBees Folder Plugin – Copy Artifact Plugin – Delivery Pipeline Plugin – Join Plugin – PostBuild Script Plugin

Practical PHP Deployment with Jenkins ● 25 Resources – http://zend.com – http://zend.com/en/solutions/continuous-delivery – http://github.com/zend-patterns – GitHub – Jenkins – http://phpqatools.org

● Thank you! – Code: https://github.com/adamculp/ Adam Culp http://www.geekyboy.com http://RunGeekRadio.com Twitter @adamculp Questions?