The world for developers is becoming more and more agile. This increases the importance of having a great deploy process. Being able to adapt and react fast to changes is the way to stay agile. With a slow or complicated deploy process it becomes impossible to stay agile. You want to be able to respond fast to feedback and iterate with a fast and easy deploy (or rollback). That is the agile way. A deploy is an important part of the software development process. Somehow it has been forgotten a bit in the PHP community. I hope to share my thoughts and experiences in this book to aid you in optimizing your deploy process. "Software rot" is something that happens to code if it's not maintained in a proper way. When it comes to deploy I call it "shipping rot". Let's try to stay away from that and treat our deploy process as any other important part of our applications. You might be a developer. You might be the manager of or product owner to a team of developers. You will benefit from this whomever you might be. Whether you want to optimize the deploy process for technical or management reasons doesn't matter. The style of the book will not be in the form of that you need to read the entire thing from start to finish. You could pick the areas where your process is suffering and focus on that. There will be both theory and technical implementation of the concepts. Table of Contents 4 Introduction 7 Background 7 Who it's for 8 Outside its scope 8 Assumptions 8 About the author 9 Code samples 9 Thanks to 9 1. Automate, automate, automate 10 1.1 One button to rule them all 10 1.2 Example of a manual step 10 1.3 Time is always a factor 11 2. Goals 12 2.1 How it usually begins 12 2.2 Maturity 13 2.3 Agility 14 2.4 Plan for a marathon 15 2.5 Release cycles 16 2.6 Technical debt and rot 17 2.7 The list 18 3. Environments 19 3.1 Repeatable 19 3.2 Configuration / environment variables 20 3.3 Local environment 22 3.4 Development environment 23 3.5 Staging environment 23 3.6 Production environment 24 3.7 Testing environment(s) 24 3.8 Simplify server access 25 4. Atomic deploys 27 4.1 What is atomicity? 28 4.2 Achieving atomicity 28 4.3 Concept of builds 29 4.4 File persisted data (shared data) 29 4.5 Symbolic folder links 30 4.6 Proposed folder structure 30 4.7 Pseudo deploy process 31 5. Tools 32 5.1 Git hooks 33 5.2 Phing 44 5.3 Capistrano 55 5.4 Rocketeer 60 6. Version control 65 6.1 Git-flow 65 6.2 Main branches 66 6.3 Feature branches 66 6.4 Release branches 67 6.5 Hotfix branches 67 6.6 Labs branches 67 7. Dependencies 68 7.1 Semantic Versioning 68 7.2 Version control 73 7.3 Development dependencies 74 7.4 The composer.lock file 74 7.5 Composer and github rate limit 75 8. Database migrations 77 8.1 Installation & configuration 77 8.2 Migration files 78 8.3 Possible data loss on rollbacks 80 8.4 Batches 80 9. Running tests 82 9.1 Unit testing 82 9.2 Acceptance testing 83 9.3 End-to-end testing 83 9.4 Manual testing 84 9.5 What, where and when 84 9.6 Failing tests 85 10. Logs and notifications 86 10.1 Saving logs 86 10.2 Types of notification 87 10.3 Useful git commands 92 Conclusion 93