Automating WebApplication Deployment      Mathew Byrne - July 2011
Introduction• What is the problem?• What is deployment? •   Web application life-cycle.• My background — JB Interactive. •...
Why Automate       Deployment?• Automated, repeatable, consistent process.• Light-weight code changes.• Manage configuratio...
Deployment Tools• Lots of tools already in existence: • Fabric (python) • Capistrano (ruby) • Rake (ruby) • make (C)• Not ...
Phing• PHing Is Not Gnu make• A build tool; not just a deploy tool.• Uses XML configuration to automate tasks.• Based on Ap...
Why Use Phing?• Written in pure PHP - easy to hack!• Minimal dependancies.• Supported, moderate ongoing development.• Func...
What Can Phing do?• Almost anything! •   Version Control - Subversion, git, etc. •   PHPUnit/Testing •   Code analysis •  ...
Phing Basics• Project - build.xml• Targets  •   Dependency tracking.• Tasks  •   Phing building blocks.  •   Usually this ...
Phing Basics• Properties •   User variables! •   Can be stored in external files and included at     run-time. •   Can diff...
Hello World!<?xml version="1.0" encoding="UTF-8"?><project name="hello-world" default="greet">  <property name="message" v...
Hello World!
Config Management• Using properties separates tasks from  environments.• Allows for more generic deploy setups.            ...
Extending Phing• As simple as extending a base class and  pointing to it in your build script.• Lots of extensions already...
Environments• Defined by configuration.• Should have sensible defaults.• Activated by deployment process.• Important - can b...
Deploying with       Version Control• Websites are more than just <code> •   Configuration        •   User Content •   Asse...
Database Migrations• Migrations == Database versioning.• Automation required.• Should be part of the deployment process.
Conclusion• Automated deployment is highly desirable.• Lots of tools in existence.• Environment and configuration are  impo...
Upcoming SlideShare
Loading in...5
×

Automating Web Application Deployment

2,219
-1

Published on

Published in: Technology
0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,219
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
31
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Automating Web Application Deployment

    1. 1. Automating WebApplication Deployment Mathew Byrne - July 2011
    2. 2. Introduction• What is the problem?• What is deployment? • Web application life-cycle.• My background — JB Interactive. • How we automated deployment. • Benefits and business case.
    3. 3. Why Automate Deployment?• Automated, repeatable, consistent process.• Light-weight code changes.• Manage configurations and environments.• Minimise human error.• Saves time == higher efficiency• Standardise across projects.
    4. 4. Deployment Tools• Lots of tools already in existence: • Fabric (python) • Capistrano (ruby) • Rake (ruby) • make (C)• Not many established PHP solutions…
    5. 5. Phing• PHing Is Not Gnu make• A build tool; not just a deploy tool.• Uses XML configuration to automate tasks.• Based on Apache Ant.• Used by Propel, Symfony, Zend Framework, Xinc…
    6. 6. Why Use Phing?• Written in pure PHP - easy to hack!• Minimal dependancies.• Supported, moderate ongoing development.• Functionality through extending.
    7. 7. What Can Phing do?• Almost anything! • Version Control - Subversion, git, etc. • PHPUnit/Testing • Code analysis • Compilation and Minification • File Manipulation • And much, much more…
    8. 8. Phing Basics• Project - build.xml• Targets • Dependency tracking.• Tasks • Phing building blocks. • Usually this is where you extend.
    9. 9. Phing Basics• Properties • User variables! • Can be stored in external files and included at run-time. • Can differ between builds, environments and configurations. • Can be overwritten at run-time
    10. 10. Hello World!<?xml version="1.0" encoding="UTF-8"?><project name="hello-world" default="greet"> <property name="message" value="Hello World!" /> <target name="prepare"> <echo>Preparing your greeting...</echo> </target> <target name="greet" depends="prepare"> <echo msg="${message}" /> </target></project>
    11. 11. Hello World!
    12. 12. Config Management• Using properties separates tasks from environments.• Allows for more generic deploy setups. prop <?xml prop development.ini prop test.ini build.xml production.ini
    13. 13. Extending Phing• As simple as extending a base class and pointing to it in your build script.• Lots of extensions already in existence. • Read through phing documentation. • Search GitHub for “phing”• Easy to integrate with existing tools.https://github.com/mathewbyrne/closure-task
    14. 14. Environments• Defined by configuration.• Should have sensible defaults.• Activated by deployment process.• Important - can be a security issue! development staging production
    15. 15. Deploying with Version Control• Websites are more than just <code> • Configuration • User Content • Assets • Setup • Databases Schemas• Version Control is easy, but not flexible.• Deployment procedure not in VC.
    16. 16. Database Migrations• Migrations == Database versioning.• Automation required.• Should be part of the deployment process.
    17. 17. Conclusion• Automated deployment is highly desirable.• Lots of tools in existence.• Environment and configuration are important.• Automate everything!
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×