Slide 1

Slide 1 text

Unbox Development in Production JSConf Asia 2015 Nov 19+20, Singapore

Slide 2

Slide 2 text

encountered Have you this..

Slide 3

Slide 3 text

A new developer joins your team… Then you spend your next couple of days setting up their tools, development environment, configurations & etc.

Slide 4

Slide 4 text

Another developer from your team finds a tricky bug.. But you couldn’t reproduce it on your machine.

Slide 5

Slide 5 text

Solution

Slide 6

Slide 6 text

open source platform for software containerization, designed for fast delivery of applications. It allows to create lightweight, portable & self-contained apps.

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

Create & configure lightweight, reproducible & portable development environments. It wraps around virtualization software apart from its support for configuration management.

Slide 9

Slide 9 text

# download a simple VM $ vagrant box add base http://files.vagrantup.com/ precise64.box # initialise $ vagrant init # boot the VM with above configurations $ vagrant up

Slide 10

Slide 10 text

● A command-line VM management tool for developers ● Enables Portable Development Environments ● Invented by Mitchell Hashimoto (Jan 2010) ● Open Source http://github.com/mitchellh/vagrant ● Providers VMware, VirtualBox, AWS ● Provisioners Puppet, Ansible, Chef, Salt

Slide 11

Slide 11 text

a PHP dev box.. Provisioning

Slide 12

Slide 12 text

● Before we start, install these: VirtualBox, Vagrant ● Provisioning: Puppet ● Vagrant Provider: VirtualBox ● The Vagrantfile internally refers a Shell Script for software setup ● The Shell Script sets up the MAMP stack (installs Apache, PHP, MySQL & PHPMyAdmin with default configurations)

Slide 13

Slide 13 text

Demo

Slide 14

Slide 14 text

$ git clone https://github.com/hamzeen/vagrant-php-box.git $ cd vagrant-php-box $ sudo vagrant up visit here (once) to create the database and tables http localhost:1234/firstrun // clone the git repo // setup, build & deploy the vagrant project

Slide 15

Slide 15 text

We are done here! The app is ready to serve you at: http: localhost:1234 > Want to start your own vagrant project & spin up a VM of your choice? $ vagrant init debian/wheezy64 $ vagrant up > Changed Vagrantfile? $ vagrant reload $ vagrant up

Slide 16

Slide 16 text

https://github.com/hamzeen/vagrant-php-box Visit Github for the complete code

Slide 17

Slide 17 text

Vagrant vs Docker Showdown

Slide 18

Slide 18 text

● Both allows to configure portable Dev Envs & employ LxC (Linux Containers) Vagrant ● Focus: Portable Dev Envs ● Virtualization: Interfaces with VM Managers ● Since Jan 2010 Docker ● Focus: Production & Deployment ● Containers not Virtual Machines ● Fast ● Since Mar 2013

Slide 19

Slide 19 text

Thank You You were awesome!

Slide 20

Slide 20 text

Hamzeen Hameem http://hamzeen.github.io @hamzeen twitter | github | medium