practical php deployment with jenkins
DESCRIPTION
When pushes to production fail the "blame game" starts between developers and devops, then everyone scurries to figure out what happened...fast! Adam Culp will show how a PHP application can be deployed flawlessly using Jenkins. Then see how "Dev" and "Ops" are supported by a system if the application breaks and the nightmare happens.TRANSCRIPT
![Page 1: Practical PHP Deployment with Jenkins](https://reader034.vdocument.in/reader034/viewer/2022051313/5488a198b47959f60c8b56bd/html5/thumbnails/1.jpg)
1
Practical PHP Deploymentwith Jenkins
By:
Adam CulpTwitter: @adamculp
https://joind.in/12207
![Page 2: Practical PHP Deployment with Jenkins](https://reader034.vdocument.in/reader034/viewer/2022051313/5488a198b47959f60c8b56bd/html5/thumbnails/2.jpg)
2
Practical PHP Deployment with Jenkins
● 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
![Page 3: Practical PHP Deployment with Jenkins](https://reader034.vdocument.in/reader034/viewer/2022051313/5488a198b47959f60c8b56bd/html5/thumbnails/3.jpg)
3
Practical PHP Deployment with Jenkins
● Dev VS Ops
– Dev = Ops
– Dev doesn't like Ops
– Can't communicate
– Challenges syncing
![Page 4: Practical PHP Deployment with Jenkins](https://reader034.vdocument.in/reader034/viewer/2022051313/5488a198b47959f60c8b56bd/html5/thumbnails/4.jpg)
4
Practical PHP Deployment with Jenkins
● Continuous Delivery
– Not a single app solution
– Many pieces
– Not covered here
● Provisioning of servers● Integration to monitoring
– We will focus on:
![Page 5: Practical PHP Deployment with Jenkins](https://reader034.vdocument.in/reader034/viewer/2022051313/5488a198b47959f60c8b56bd/html5/thumbnails/5.jpg)
5
Practical PHP Deployment with Jenkins
● Continuous Integration
![Page 6: Practical PHP Deployment with Jenkins](https://reader034.vdocument.in/reader034/viewer/2022051313/5488a198b47959f60c8b56bd/html5/thumbnails/6.jpg)
6
Practical PHP Deployment with Jenkins
● Deployment
– FTP works...NOT!
– Many large PHP sites
– Simple != solution
![Page 7: Practical PHP Deployment with Jenkins](https://reader034.vdocument.in/reader034/viewer/2022051313/5488a198b47959f60c8b56bd/html5/thumbnails/7.jpg)
7
Practical PHP Deployment with Jenkins
● 5 to 7 Releases...A Day!
– Not achievable with FTP
– Must be automated
![Page 8: Practical PHP Deployment with Jenkins](https://reader034.vdocument.in/reader034/viewer/2022051313/5488a198b47959f60c8b56bd/html5/thumbnails/8.jpg)
8
Practical PHP Deployment with Jenkins
● Ready To Deploy!
– Not after every commit
– Always “ready”
![Page 9: Practical PHP Deployment with Jenkins](https://reader034.vdocument.in/reader034/viewer/2022051313/5488a198b47959f60c8b56bd/html5/thumbnails/9.jpg)
9
Practical PHP Deployment with Jenkins
● Best Practices
– No holy grail here
– Many dependencies
● Development team● Application● Size of application● How to implement
![Page 10: Practical PHP Deployment with Jenkins](https://reader034.vdocument.in/reader034/viewer/2022051313/5488a198b47959f60c8b56bd/html5/thumbnails/10.jpg)
10
Practical PHP Deployment with Jenkins
● Architecture
– Git
– Jenkins
– Zend Server
![Page 11: Practical PHP Deployment with Jenkins](https://reader034.vdocument.in/reader034/viewer/2022051313/5488a198b47959f60c8b56bd/html5/thumbnails/11.jpg)
11
Practical PHP Deployment with Jenkins
● Zend Server
– Full PHP application stack
– Supported
– Consistent across OS
– Automated deployment
– Cluster management
![Page 12: Practical PHP Deployment with Jenkins](https://reader034.vdocument.in/reader034/viewer/2022051313/5488a198b47959f60c8b56bd/html5/thumbnails/12.jpg)
12
Practical PHP Deployment with Jenkins
● WebAPI – Restful Service
– Built API first
– GUI is just the front-end
![Page 13: Practical PHP Deployment with Jenkins](https://reader034.vdocument.in/reader034/viewer/2022051313/5488a198b47959f60c8b56bd/html5/thumbnails/13.jpg)
13
Practical PHP Deployment with Jenkins
● Source Control
– !Github here (just in case)
– Using Git
![Page 14: Practical PHP Deployment with Jenkins](https://reader034.vdocument.in/reader034/viewer/2022051313/5488a198b47959f60c8b56bd/html5/thumbnails/14.jpg)
15
Practical PHP Deployment with Jenkins
● PHP QA Tools
– http://phpqatools.org
● PHPUnit● pdepend
![Page 15: Practical PHP Deployment with Jenkins](https://reader034.vdocument.in/reader034/viewer/2022051313/5488a198b47959f60c8b56bd/html5/thumbnails/15.jpg)
16
Practical PHP Deployment with Jenkins
● Docker
– Linux Containers
– Versioned (“Git for servers”)
– Stores delta
![Page 16: Practical PHP Deployment with Jenkins](https://reader034.vdocument.in/reader034/viewer/2022051313/5488a198b47959f60c8b56bd/html5/thumbnails/16.jpg)
17
Practical PHP Deployment with Jenkins
● When Apps Break
– What's really to blame?
![Page 17: Practical PHP Deployment with Jenkins](https://reader034.vdocument.in/reader034/viewer/2022051313/5488a198b47959f60c8b56bd/html5/thumbnails/17.jpg)
18
Practical PHP Deployment with Jenkins
● Root Cause Analysis
– What is the cause
● How to prevent● How to fix
– Needs to happen fast!
![Page 18: Practical PHP Deployment with Jenkins](https://reader034.vdocument.in/reader034/viewer/2022051313/5488a198b47959f60c8b56bd/html5/thumbnails/18.jpg)
19
Practical PHP Deployment with Jenkins
● Rollback
– Within 30 seconds
● Even in a cluster!
![Page 19: Practical PHP Deployment with Jenkins](https://reader034.vdocument.in/reader034/viewer/2022051313/5488a198b47959f60c8b56bd/html5/thumbnails/19.jpg)
20
Practical PHP Deployment with Jenkins
● Demo
– Using Pimcore CMS (500K lines of code)
– Jenkins
● Multiple jobs from:
– Checkout– Testing– Packaging– Deployment to staging– Rollback– Deploy to production (cluster)
– Then we'll see the details
![Page 20: Practical PHP Deployment with Jenkins](https://reader034.vdocument.in/reader034/viewer/2022051313/5488a198b47959f60c8b56bd/html5/thumbnails/20.jpg)
23
Practical PHP Deployment with Jenkins
● Resources
– http://zend.com
– http://zend.com/en/solutions/continuous-delivery
– http://github.com/zend-patterns
![Page 21: Practical PHP Deployment with Jenkins](https://reader034.vdocument.in/reader034/viewer/2022051313/5488a198b47959f60c8b56bd/html5/thumbnails/21.jpg)
● Thank you!
– Code: https://github.com/adamculp/
– Please rate at: https://joind.in/12207
Adam Culp
http://www.geekyboy.com
Twitter @adamculp
Questions?