Upload
niklas-modess
View
175
Download
4
Embed Size (px)
DESCRIPTION
The world of PHP is very interesting right now and it has been catching up on best coding practices. It's time we bring our deploy processes up to par with this and start using best practices for it as well. So what are the goals for it and which steps can be taken to reach them? How can we make the process fit better into the more and more Agile world we live in?
Citation preview
DEPLOYING PHPAPPLICATIONS
By Niklas Modess
WHO AM I?@niklasmodess
codingswag.com
Freelance / consultant web architect
Developed and deployed PHP applications for 10+ years
Currently developing mostly in Laravel
Co-organizer of the meetup group Laravel Stockholm
THE BOOK
https://leanpub.com/deploying-php-
applications/c/SYMFONYCAMP
$9.99 with this link ($5 discount)
WHY AM I HERE?To sell my book ;)
To spread deployment process awareness
Discuss goals and steps for deployment
WHAT I'M NOT HERE FORTalk about deployment tools
Talk about server provisioning tools
Show you commands
Show you code
Discuss system specific things
WHY SHOULD WE TALK ABOUT THIS?It's about time we do it
Helps our entire development process
Gain confidence as a developer
THE PHP WORLD
PHP: a fractal of bad design
FUCK THE HATERS
EXCITING TIMES!Best practices
Testing
Continous integration
.. and even OOP
BUT...What happened to deployment in all this?
THE AGILE WORLDAgile: "Characterized by quickness, lightness,
and ease of movement."
Staying agile with deployment is about
RESPONDING QUICKLYTO FEEDBACK
Work in
SPRINTSbut plan for the
MARATHON
RELEASE CYCLESThe new version is done, ship it.
I'm done, ship it.
X amount of time has passed, ship it.
I pushed it, ship it.
ENVIRONMENTS
THE USUAL ONESLocal
Development
Staging
Production
(Testing)
QUESTIONSDo we have separate environments?
Are they repeatable/provisioned?
Do we have a branching strategy for our version control?
Staging as close to production as possible?
PITFALL #1This:
{ id: 1}
Can turn into this:
{ id: "1"}
PITFALL #2PascalCasedClass.php
class PascalCasedClass {}
index.php
require_once('Pascalcasedclass.php');
Will only work in enviroment that handles its file system case
insensitive.
I LIKE DIVERSITYAs long as it stays out of my software environments
THE STORY ABOUT AN APPLICATION.. come up with an idea
.. do some wireframes
.. code, code, code
.. celebrate finishing code
.. shit, we have to deploy it
.. well, do it quickly then
The deployment process is almost always
AD HOCA reaction to your applications state
"Duct tape deployment""
AUTOMATEEVERYTHING!
MANUL STEPSAre the root of all evil
AN EXAMPLE OF A MANUAL STEPclass Assets { const REVISION = 14;}
<link rel="stylesheet" href="style.css?v=<?=Assets::REVISION?>" type="text/css">
THE GOALSIn a nice and ordered list
WE WANT IT TO BEAutomated
Responsive
Atomic
Reversible
Simple
Fast
Agnostic
ROLLBACKSAre just as important, and should comply with the goals
MATURITYA quite natural process (hopefully)
THE STEPSDocumentation
Automation
Verification
Notification
Tests
Tools
Monitoring
WHAT COULD IT TAKE CARE OF?Running tests
Database migrations
Cache bust & warm up
Dependencies
Static assets/contents
Generate documentation
Restart services
Restart queues / workers
Symlink folders
... any tool with a cli or api
THANK YOU!
QUESTIONS?