Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Vagrant for WordPress Development
Search
Lew Goettner
October 20, 2012
Technology
7
770
Vagrant for WordPress Development
An overview of Vagrant, virtualization, and how it could be used to ease WordPress development.
Lew Goettner
October 20, 2012
Tweet
Share
More Decks by Lew Goettner
See All by Lew Goettner
Consistent Local Development with Vagrant & Chef
lewg
4
1k
Other Decks in Technology
See All in Technology
re:Invent をおうちで楽しんでみた ~CloudWatch のオブザーバビリティ機能がスゴい!/ Enjoyed AWS re:Invent from Home and CloudWatch Observability Feature is Amazing!
yuj1osm
0
120
株式会社ログラス − エンジニア向け会社説明資料 / Loglass Comapany Deck for Engineer
loglass2019
3
31k
Amazon VPC Lattice 最新アップデート紹介 - PrivateLink も似たようなアップデートあったけど違いとは
bigmuramura
0
190
Jetpack Composeで始めるServer Cache State
ogaclejapan
2
170
開発生産性向上! 育成を「改善」と捉えるエンジニア育成戦略
shoota
1
300
新機能VPCリソースエンドポイント機能検証から得られた考察
duelist2020jp
0
220
オプトインカメラ:UWB測位を応用したオプトイン型のカメラ計測
matthewlujp
0
170
re:Invent 2024 Innovation Talks(NET201)で語られた大切なこと
shotashiratori
0
310
Fanstaの1年を大解剖! 一人SREはどこまでできるのか!?
syossan27
2
160
多領域インシデントマネジメントへの挑戦:ハードウェアとソフトウェアの融合が生む課題/Challenge to multidisciplinary incident management: Issues created by the fusion of hardware and software
bitkey
PRO
2
100
Turing × atmaCup #18 - 1st Place Solution
hakubishin3
0
470
成果を出しながら成長する、アウトプット駆動のキャッチアップ術 / Output-driven catch-up techniques to grow while producing results
aiandrox
0
250
Featured
See All Featured
The Cost Of JavaScript in 2023
addyosmani
45
7k
Music & Morning Musume
bryan
46
6.2k
KATA
mclloyd
29
14k
Keith and Marios Guide to Fast Websites
keithpitt
410
22k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
48
2.2k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
1.2k
Faster Mobile Websites
deanohume
305
30k
For a Future-Friendly Web
brad_frost
175
9.4k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
365
25k
Designing on Purpose - Digital PM Summit 2013
jponch
116
7k
Automating Front-end Workflow
addyosmani
1366
200k
Navigating Team Friction
lara
183
15k
Transcript
Vagrant for WordPress Development Lew Goettner @lewg #WCPhilly October 20,
2012 Saturday, October 20, 12
about me Saturday, October 20, 12
LEWIS JOSEPH GOETTNER THE @lewg Saturday, October 20, 12
Saturday, October 20, 12
By JSquish (Own work) [CC-BY-SA-3.0 (http://creativecommons.org/licenses/by-sa/3.0)], via Wikimedia Commons Saturday,
October 20, 12
By TexasDex at en.wikipedia [GFDL (http://www.gnu.org/copyleft/fdl.html) or CC-BY-SA-3.0 (http://creativecommons.org/ licenses/by-sa/3.0/)],
from Wikimedia Commons Saturday, October 20, 12
Saturday, October 20, 12
Wharton Computing Saturday, October 20, 12
PHP WordPress ColdFusion Windows Ubuntu/Red Hat MSSQL MySQL Ruby Saturday,
October 20, 12
Supporting non-technical users Slower adoption of new technology Legacy systems
There is always room for a better way! When you’re stuck in the middle.. Saturday, October 20, 12
storytime Saturday, October 20, 12
“Here’s a shared dev space.” - Sysadmin the progression... Saturday,
October 20, 12
“I’ll just run it locally.” - Developer the progression... Saturday,
October 20, 12
“I’ll run it in a VM!” - Developer the progression...
Saturday, October 20, 12
“I’ll run it in a chef-configured VM!” - Developer the
progression... Saturday, October 20, 12
“I’ll run it in a chef-configured VM, based on a
post-install snapshot.” - Developer the progression... Saturday, October 20, 12
“Why don’t we all start using this?” - Boss /
Coworker / Intern the progression... Saturday, October 20, 12
“Shit.” - Developer the progression... Saturday, October 20, 12
vagrant Saturday, October 20, 12
“Vagrant uses Oracle’s VirtualBox to build configurable, lightweight, and portable
virtual machines dynamically.” - http://vagrantup.com Saturday, October 20, 12
VirtualBox Saturday, October 20, 12
“VirtualBox is a general-purpose full virtualizer for x86 hardware, targeted
at server, desktop and embedded use.” - virtualbox.org Saturday, October 20, 12
“VirtualBox is a general-purpose full virtualizer for x86 hardware, targeted
at server, desktop and embedded use.” - virtualbox.org FREE! Saturday, October 20, 12
“I love the command line.” - Lew Saturday, October 20,
12
Assumption: You’ve installed both VirtualBox and Vagrant. 3 Lines =
A Running VM Saturday, October 20, 12
% vagrant box add precise32 \ http://files.vagrantup.com/ precise32.box % vagrant
init precise32 % vagrant up 3 Lines = A Running VM Saturday, October 20, 12
% vagrant box add precise32 \ http://files.vagrantup.com/ precise32.box % vagrant
init precise32 % vagrant up Saturday, October 20, 12
Base OS Install Software for access & configuration VirtualBox Guest
Additions Base Box Saturday, October 20, 12
Built in tools for management: % vagrant box -h %
vagrant package -h Base Box Saturday, October 20, 12
VeeWee: tool for building your own https://github.com/jedi4ever/veewee Base Box Saturday,
October 20, 12
% vagrant box add precise32 \ http://files.vagrantup.com/ precise32.box % vagrant
init precise32 % vagrant up Saturday, October 20, 12
% vagrant box add precise32 \ http://files.vagrantup.com/ precise32.box % vagrant
init precise32 % vagrant up Saturday, October 20, 12
Vagrantfile = a Project Project = 1 to many VMs
Vagrantfile Saturday, October 20, 12
Text file Ruby DSL for configuring your VM(s) (no ruby
skills required) Vagrantfile Saturday, October 20, 12
% vagrant box add precise32 \ http://files.vagrantup.com/ precise32.box % vagrant
init precise32 % vagrant up Saturday, October 20, 12
vagrant up http://www.flickr.com/photos/lightningjeff/7505934038/ Saturday, October 20, 12
“There’s potential here.” -Developer Saturday, October 20, 12
“VIM is the bee’s knees!” - Developer A The Holy
Wars Saturday, October 20, 12
“Textmate would throat punch VIM!” - Developer B The Holy
Wars Saturday, October 20, 12
“Let’s fight to the death!!” - Both Developers The Holy
Wars Saturday, October 20, 12
“Let’s talk this thing to death in IRC!!” - Both
Developers The Holy Wars Saturday, October 20, 12
Vagrantfile config.vm.share_folder "web", "/var/www", "~/my-site", :nfs => true Saturday, October
20, 12
Vagrantfile config.vm.share_folder "web", "/var/www", "~/my-site", :nfs => true Identifier Saturday,
October 20, 12
Vagrantfile config.vm.share_folder "web", "/var/www", "~/my-site", :nfs => true Identifier Path
on VM Saturday, October 20, 12
Vagrantfile config.vm.share_folder "web", "/var/www", "~/my-site", :nfs => true Identifier Path
on VM Path on your workstation Saturday, October 20, 12
Vagrantfile config.vm.share_folder "web", "/var/www", "~/my-site", :nfs => true Identifier Path
on VM Path on your workstation NFS for Performace Saturday, October 20, 12
By Julius Schorzman (Own work) [CC-BY-SA-2.0 (http://creativecommons.org/licenses/by-sa/2.0)], via Wikimedia Commons
Saturday, October 20, 12
Saturday, October 20, 12
0 1 2 3 Number of Children Coffee Consuption Sleep
Saturday, October 20, 12
Saturday, October 20, 12
WordPress Convenience Strength: Saturday, October 20, 12
% vagrant box add precise32 \ http://files.vagrantup.com/ precise32.box % vagrant
init precise32 Add our base box, initialize Saturday, October 20, 12
Vagrantfile (add networking) config.vm.network :hostonly, "192.168.33.10" (uncomment that line) Saturday,
October 20, 12
% vagrant up % vagrant ssh Fire it up, SSH
in Saturday, October 20, 12
Inside the VM - Setup a LAMP Stack % sudo
apt-get update % sudo apt-get install apache2 mysql- server php5 php5-mysql % mysqladmin -u root -p create wordpress % exit Saturday, October 20, 12
Saturday, October 20, 12
Package it Up % vagrant halt % vagrant package --output
wplamp.box (spits out a wplamp.box file) % vagrant box add wplamp wplamp.box Saturday, October 20, 12
“Why did we just do that?” -You Guys Saturday, October
20, 12
Vagrantfile (in a new folder) Vagrant::Config.run do |config| config.vm.box =
"wplamp" config.vm.network :hostonly, "192.168.33.11" config.vm.share_folder "wordpress", "/var/www", "../wordpress", :nfs => true end Saturday, October 20, 12
Saturday, October 20, 12
“Mind sharing?” Saturday, October 20, 12
Vagrantfile (port forwarding) Vagrant::Config.run do |config| config.vm.box = "wplamp" config.vm.box_url
= "http://you.com/wplamp.box" config.vm.network :hostonly, "192.168.33.11" config.vm.share_folder "wordpress", "/var/www", "../wordpress", :nfs => true end Saturday, October 20, 12
Vagrantfile (port forwarding) Vagrant::Config.run do |config| config.vm.box = "wplamp" config.vm.box_url
= "http://you.com/wplamp.box" config.vm.network :hostonly, "192.168.33.11" config.vm.share_folder "wordpress", "/var/www", "../wordpress", :nfs => true end The Interwebs! Saturday, October 20, 12
“Can I take a look at that?” Saturday, October 20,
12
Vagrantfile (port forwarding) Vagrant::Config.run do |config| config.vm.box = "wplamp" config.vm.forward_port
80, 8080 config.vm.network :hostonly, "192.168.33.11" config.vm.share_folder "wordpress", "/var/www", "../wordpress", :nfs => true end Saturday, October 20, 12
Vagrantfile (port forwarding) Vagrant::Config.run do |config| config.vm.box = "wplamp" config.vm.forward_port
80, 8080 config.vm.network :hostonly, "192.168.33.11" config.vm.share_folder "wordpress", "/var/www", "../wordpress", :nfs => true end VM Saturday, October 20, 12
Vagrantfile (port forwarding) Vagrant::Config.run do |config| config.vm.box = "wplamp" config.vm.forward_port
80, 8080 config.vm.network :hostonly, "192.168.33.11" config.vm.share_folder "wordpress", "/var/www", "../wordpress", :nfs => true end VM Workstation Saturday, October 20, 12
“One more thing..” -Bill Gates Saturday, October 20, 12
“One more thing..” -Steve Jobs Saturday, October 20, 12
% vagrant destroy Saturday, October 20, 12
Saturday, October 20, 12
vagrant destroy Blow away the VM. But what’s left? Everything
required to recreate it at will! Save space, fix problems, tinker at will. Saturday, October 20, 12
? Saturday, October 20, 12
Distributing And a word of caution Saturday, October 20, 12
“VCS or GTFU” - Mark Jaquith Saturday, October 20, 12
“DVCS or GTFU” - Lew Saturday, October 20, 12
Saturday, October 20, 12
Whoops. Saturday, October 20, 12
“VCS or GTFO” - Mark Jaquith Saturday, October 20, 12
Grow the F*ck Up Used when adults are acting like
kids. - urbandictionary.com GTFU Saturday, October 20, 12
“DVCS or GTFU” - Lew Saturday, October 20, 12
“Git or get out?” - Lew meh.. Saturday, October 20,
12
“Modern version control systems make these setups insanely easy to
distribute and modify.” - Lew What I’m trying to say.. Saturday, October 20, 12
% git clone http://my-setup % vagrant up How Easy? Saturday,
October 20, 12
? Saturday, October 20, 12
Recap Powered by meme Saturday, October 20, 12
Saturday, October 20, 12
Developer - Before Local Dev? Don’t want it on all
the time. 1 VM? Mixing Libraries, Dependencies, etc. Multiple VMs: Painful to manage, GBs Saturday, October 20, 12
Developer - After A dedicated, disposable, consistent development environment... per
project! Saturday, October 20, 12
Saturday, October 20, 12
Organization - Before Fixed/shared dev? Developers like different tools Onboarding?
Long time from hire to productivity Saturday, October 20, 12
Organization - After Providing consistent local development leads to smoother
deployments, drastically shortens on- boarding time, and puts no regulations on developer tools. Saturday, October 20, 12
Saturday, October 20, 12
+ or Saturday, October 20, 12
Homer Liwag [CC-BY-SA-3.0-2.5-2.0-1.0 (www.creativecommons.org/licenses/by-sa/3.0)], via Wikimedia Commons Configuration Management Saturday,
October 20, 12
config.vm.provision :chef_solo do |chef| chef.cookbooks_path = "~/my-cookbooks" chef.roles_path = "~/my-roles"
chef.add_role "my_app_server" end Vagrantfile Saturday, October 20, 12
WordPress Convenience Strength: Saturday, October 20, 12
“Everybody is using it.” Goal: Provide easy to use directions
to setup a dev environment for non- developers. Saturday, October 20, 12
“You hacked the core?” Goal: Provide your setup to vendors
with a clear acceptance path. Saturday, October 20, 12
“You don’t run any servers?” Goal: Provide a setup to
your clients where they can play with the site in- house. Saturday, October 20, 12
“You said this worked on 3.0?” Goal: Test one plugin
or theme across multiple versions of WordPress. Saturday, October 20, 12
Install WordPress, plugins, themes, and map appropriate folders. http://github.com/lewg/wordpress-vagrant 1
Site = 1 Setup Repo Saturday, October 20, 12
In Practice Consistent Local Development for our most complicated WordPress
install. Saturday, October 20, 12
What’s it do? Creates a new Ubuntu 12.04 VM Installs
and configures all server software Apache, PHP, MySQL, Apt, Subversion Downloads & Installs WordPress Saturday, October 20, 12
What’s it do? Creates a new Ubuntu 12.04 VM Installs
and configures all server software Apache, PHP, MySQL, Apt, Subversion Downloads & Installs WordPress Saturday, October 20, 12
What’s it do? Creates a new Ubuntu 12.04 VM Installs
and configures all server software Apache, PHP, MySQL, Apt, Subversion Downloads & Installs WordPress Saturday, October 20, 12
What’s it do? Installs 30 wordpress.org plugins Installs 3 paid
plugins via mapped folder Maps in custom theme folder (own repo) Apache, PHP, MySQL Saturday, October 20, 12
What’s it do? Installs 30 wordpress.org plugins Installs 3 paid
plugins via mapped folders Maps in custom theme folder (own repo) Apache, PHP, MySQL Saturday, October 20, 12
What’s it do? Installs 30 wordpress.org plugins Installs 3 paid
plugins via mapped folder Maps in custom theme folder (own repo) Apache, PHP, MySQL Saturday, October 20, 12
What does it REALLY do? Takes a complicated and time
consuming process, and reduces it to a few minutes. Saturday, October 20, 12
Vagrant http://vagrantup.com @mitchellh VeeWee https://github.com/jedi4ever/ veewee Git http://git-scm.com/ Ruby http://www.ruby-lang.org/
Chef http://opscode.com @opscode https://github.com/opscode https://github.com/opscode- cookbooks Librarian https://github.com/ applicationsonline/librarian My Github Stuff https://github.com/lewg/ Saturday, October 20, 12