Your SlideShare is downloading. ×
  • Like
Virtualização do Ambiente de Desenvolvimento com Vagrant
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Virtualização do Ambiente de Desenvolvimento com Vagrant

  • 1,142 views
Published

"Lightning Talk" realizado no encontro mensal "PHPubSP" (Grupo de usuários PHP de São Paulo) - http://phpsp.org.br/2012/08/phpubsp-talks/

"Lightning Talk" realizado no encontro mensal "PHPubSP" (Grupo de usuários PHP de São Paulo) - http://phpsp.org.br/2012/08/phpubsp-talks/

Published in Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
  • muito boa a apresentacao, Mario!
    Are you sure you want to
    Your message goes here
No Downloads

Views

Total Views
1,142
On SlideShare
0
From Embeds
0
Number of Embeds
2

Actions

Shares
Downloads
9
Comments
1
Likes
3

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Virtualização do Ambiente de Desenvolvimento com Vagrant Crie e configure ambientes leves, reproduzíveis e portáteis. Mario Rezendehttp://vagrantup.com http://about.me/mariorez
  • 2. Configuração do Ambiente de Dev Host Machine Virtual Machine● Dependente do Sistema Operacional ● Ambiente não interfere na maquina "Host" (isolamento)● Softwares relevantes ao Desenvolvimento ● Reproduzir Ambiente de Produção com● Duplicidade de Softwares exatidão. ( Apache x Nginx | MySQL x Postgre ) ● Varios Ambientes com configuração● Dificil reproduzir Ambiente de Produção diferentes (Apache x Nginx / MySQL x Postgre)● Maior velocidade na execusão ● Lentidão na execução
  • 3. Antes de tudo...● Instale VirtualBox -> http://www.virtualbox.org● Instale Vagrant -> http://downloads.vagrantup.com [ Ubuntu: apt-get install vagrant ]
  • 4. Criando um Ambiente Virtual$ vagrant box add lucid32 http://files.vagrantup.com/lucid32.box$ vagrant box add debian-squeeze-64 ~/my_boxes/debian-squeeze-64.box[vagrant] Downloading with Vagrant::Downloaders::File...[vagrant] Copying box to temporary location...[vagrant] Extracting box...[vagrant] Verifying box...[vagrant] Cleaning up downloaded box...
  • 5. Vagrantfile configurações do ambiente$ vagrant init lucid32
  • 6. Vagrantfile configurações do ambiente$ vagrant init debian-squeeze-64
  • 7. Vagrant up "levantando" o ambiente$ vagrant up[default] Importing base box debian-squeeze-64...[default] Matching MAC address for NAT networking...[default] Clearing any previously set forwarded ports...[default] Forwarding ports...[default] -- 22 => 2222 (adapter 1)[default] -- 3306 => 3309 (adapter 1)[default] -- 80 => 9090 (adapter 1)[default] Exporting NFS shared folders...[vagrant] Preparing to edit /etc/exports. Administrator privileges will be required...[sudo] password for mario: * Stopping NFS kernel daemon [ OK ] * Unexporting directories for NFS kernel daemon... [ OK ] * Exporting directories for NFS kernel daemon... [ OK ] * Starting NFS kernel daemon [ OK ][default] Creating shared folders metadata...[default] Clearing any previously set network interfaces...[default] Preparing network interfaces based on configuration...[default] Booting VM...[default] Waiting for VM to boot. This can take a few minutes.[default] VM booted and ready for use![default] Configuring and enabling network interfaces...[default] Mounting shared folders...[default] -- v-root: /vagrant[default] Mounting NFS shared folders...
  • 8. Vagrant ssh acessando a VMmario@deep-thought:~/Projects/test$ ls -altotal 16drwxrwxr-x 2 mario mario 4096 Aug 28 03:00 .drwxrwxr-x 6 mario mario 4096 Aug 28 01:47 ..-rw-rw-r-- 1 mario mario 61 Aug 28 02:31 .vagrant-rw-rw-r-- 1 mario mario 306 Aug 28 02:27 Vagrantfilemario@deep-thought:~/Projects/test$mario@deep-thought:~/Projects/test$ vagrant sshLinux vagrant-debian-squeeze 2.6.32-5-amd64 #1 SMP Sun May 6 04:00:17 UTC2012 x86_64Last login: Tue Aug 28 02:55:17 2012 from 10.0.2.2vagrant@vagrant-debian-squeeze:~$ cd /vagrant/vagrant@vagrant-debian-squeeze:/vagrant$ ls -altotal 16drwxrwxr-x 2 vagrant vagrant 4096 Aug 28 03:00 .drwxr-xr-x 23 root root 4096 Aug 28 02:33 ..-rw-rw-r-- 1 vagrant vagrant 61 Aug 28 02:31 .vagrant-rw-rw-r-- 1 vagrant vagrant 306 Aug 28 02:27 Vagrantfilevagrant@vagrant-debian-squeeze:/vagrant$
  • 9. Multi-VM ambientes multiplos$ vagrant up$ vagrant up web$ vagrant up db
  • 10. Criando Box distrubua seu ambiente$ vagrant package --vagrantfile Vagrantfile.pkg --include README.txt[default] Attempting graceful shutdown of VM...[default] Clearing any previously set forwarded ports...[default] Creating temporary directory for export...[default] Exporting VM...[default] Compressing package to: /home/mario/Projects/test/package.box[default] Packaging additional file: Vagrantfile.pkg[default] Packaging additional file: README.txtmario@deep-thought:~/Projects/test$ ls -altotal 467512drwxrwxr-x 2 mario mario 4096 Aug 28 03:19 .drwxrwxr-x 6 mario mario 4096 Aug 28 01:47 ..-rw-rw-r-- 1 mario mario 478708224 Aug 28 03:20 package.box-rw-rw-r-- 1 mario mario 0 Aug 28 03:18 README.txt-rw-rw-r-- 1 mario mario 61 Aug 28 02:31 .vagrant-rw-rw-r-- 1 mario mario 306 Aug 28 02:27 Vagrantfile-rw-rw-r-- 1 mario mario 306 Aug 28 02:27 Vagrantfile.pkg
  • 11. Provisioners cofigure seu ambiente via scripts
  • 12. VALEU !!!● Vagrant -> http://vagrantup.com● Vagrant Boxes -> http://www.vagrantbox.es● VirtualBox -> http://www.virtualbox.org Mario Rezende http://about.me/mariorez