PHP London Meetup 2012

download PHP London Meetup 2012

of 17

Transcript of PHP London Meetup 2012

  • 7/30/2019 PHP London Meetup 2012

    1/17

    About the Speaker

    Originally from Cape Town South Africa been living and working inLondon for 6 years.

    Developing with PHP on the lamp stack since 2002.

    Currently work at a well known charity on their scalable fundraisingplatform.

    Follow me on twitter @jeremyquinton

  • 7/30/2019 PHP London Meetup 2012

    2/17

  • 7/30/2019 PHP London Meetup 2012

    3/17

    The future of Development

    @mitchellh creator and maintainer of vagrant

  • 7/30/2019 PHP London Meetup 2012

    4/17

    WHY?

    Vagrant lowers development environment

    setup time, maximize dev/prod parity, andmakes the

    works on my machine

    excuse arelic of the past.

    -http://vagrantup.com

    http://www.12factor.net

    http://www.12factor.net/http://www.12factor.net/
  • 7/30/2019 PHP London Meetup 2012

    5/17

  • 7/30/2019 PHP London Meetup 2012

    6/17

    Components of a virtualiseddevelopment environment

    Virtualbox - virtualisation layer. Vagrant

    Provisioning tool like chef or puppet.

  • 7/30/2019 PHP London Meetup 2012

    7/17

    Virtual Box

    Virutalisation product freely available as Open Source Software under (GPL) version 2.

    Supports all major platforms.https://www.virtualbox.org/manual/ch01.html#hostossupport

    Community effort backed by a big company.

    Grab a copy for your platform athttps://www.virtualbox.org/wiki/Downloads

    https://www.virtualbox.org/manual/ch01.html%23hostossupporthttps://www.virtualbox.org/wiki/Downloadshttps://www.virtualbox.org/wiki/Downloadshttps://www.virtualbox.org/manual/ch01.html%23hostossupport
  • 7/30/2019 PHP London Meetup 2012

    8/17

    Vagrant

    A tool to transparently manage all the complex parts of moderndevelopment within a virtual environment without affecting theeveryday workflow of the developer too much. - vagrantup.com

    Opensource project and written in Ruby, a command line tool.Supported on most major operating systems.

    Hashicorp - http://www.hashicorp.com/blog/announcing-hashicorp.html

    Grab a copy here - http://downloads.vagrantup.com/tags/v1.0.5 for apackage or install with ruby gems.

    http://www.hashicorp.com/blog/announcing-hashicorp.htmlhttp://www.hashicorp.com/blog/announcing-hashicorp.htmlhttp://downloads.vagrantup.com/tags/v1.0.5http://downloads.vagrantup.com/tags/v1.0.5http://www.hashicorp.com/blog/announcing-hashicorp.htmlhttp://www.hashicorp.com/blog/announcing-hashicorp.htmlhttp://www.hashicorp.com/blog/announcing-hashicorp.html
  • 7/30/2019 PHP London Meetup 2012

    9/17

    Chef

    Chef is a open source provisioning tool which was built for automatingthe cloud. https://github.com/opscode/chef http://wiki.opscode.com/display/chef/Home

    There are hundreds of recipes which are already written so you cansimply re-use them. https://github.com/opscode/cookbooks

    Can be installed via ruby gems. gem install chef

    Different configurations chef solo will be used in the examples.

    https://github.com/opscode/chefhttp://wiki.opscode.com/display/chef/Homehttps://github.com/opscode/cookbookshttps://github.com/opscode/cookbookshttp://wiki.opscode.com/display/chef/Homehttps://github.com/opscode/chef
  • 7/30/2019 PHP London Meetup 2012

    10/17

    VCS

    Windows Developer

    Mac Osx Developer

    Linux Developer

    ProductionStagingDeployment

    tool

    VagrantFile

    1. vagrant add box box_name package.box2. vagrant up3. vagrant provision

    Chef Solo Scripts

  • 7/30/2019 PHP London Meetup 2012

    11/17

    How vagrant works

    Vagrant instance is managed with Vagrantfile

    which is ruby syntax. 28 configuration options. You don t need to

    use them all I ll demo 7 today. Full list onvagrantup.com.

  • 7/30/2019 PHP London Meetup 2012

    12/17

    Basic VagrantFile

    Vagrant box file can be obtained from 3 places

  • 7/30/2019 PHP London Meetup 2012

    13/17

    Three methods to create a box file

    Method Pros Cons

    Download a box file fromhttp://www.vagrant.es

    - Simplest- Up and running quickly

    - You don t know whats onthe base box

    Using the instructions off vagrantup.com

    - Gives understanding of thespecifics of a vagrant boxsetup

    - Time consuming.- Miss a step or do a step

    wrong and you have avagrant box which has oddbehaviour

    Using the opensource projectVeeWee off github

    https://github.com/jedi4ever/veewee

    - Simpler,Powerful- Templates for most server

    operating systems

    https://github.com/jedi4ever/veeweehttps://github.com/jedi4ever/veeweehttps://github.com/jedi4ever/veeweehttps://github.com/jedi4ever/veewee
  • 7/30/2019 PHP London Meetup 2012

    14/17

    Vagrant file options

  • 7/30/2019 PHP London Meetup 2012

    15/17

    Chef configuration

  • 7/30/2019 PHP London Meetup 2012

    16/17

    Demo

    Download Virtualbox 4.1.22http://download.virtualbox.org/virtualbox/4.1.22/

    Download vagrant package or install via ruby gemshttp://downloads.vagrantup.com/tags/v1.0.5

    Add 33.33.33.10 vagrantdemo.com to /etc/hosts Get the project

    git clone http://www.github.com/jeremyquinton/vagrant_demo cd vagrant_demo

    vagrant up --no-provision vagrant provision

    Browse to vagrantdemo.com

    http://download.virtualbox.org/virtualbox/4.1.22/http://downloads.vagrantup.com/tags/v1.0.5http://github/jeremyquinton/vagrant_demohttp://github/jeremyquinton/vagrant_demohttp://downloads.vagrantup.com/tags/v1.0.5http://download.virtualbox.org/virtualbox/4.1.22/
  • 7/30/2019 PHP London Meetup 2012

    17/17

    Sources http://downloads.vagrantup.com/tags/v1

    .0.5 http://download.virtualbox.org/virtualbox

    / http://www.opscode.com/chef/

    https://github.com/jedi4ever/veewee https://github.com/mitchellh/vagrant Andy Thompson

    http://downloads.vagrantup.com/tags/v1.0.5http://downloads.vagrantup.com/tags/v1.0.5http://download.virtualbox.org/virtualbox/http://download.virtualbox.org/virtualbox/http://www.opscode.com/chef/https://github.com/jedi4ever/veeweehttps://github.com/mitchellh/vagranthttps://github.com/mitchellh/vagranthttps://github.com/jedi4ever/veeweehttp://www.opscode.com/chef/http://download.virtualbox.org/virtualbox/http://download.virtualbox.org/virtualbox/http://downloads.vagrantup.com/tags/v1.0.5http://downloads.vagrantup.com/tags/v1.0.5