1. KM Coffee & Code #3HexBrain team
Vagrant & PHP
Практика використання Vagrant у розробці
PHP додатків
2. KM Coffee & Code #3HexBrain team
Що таке Vagrant
Інструментарій для формування,
встановлення та керування образами
віртуальних машин для вирішення задач
розробки та тестування
3. KM Coffee & Code #3HexBrain team
Швидке розгортання
vagrant box add precise32 http://files.vagrantup.com/precise32.box
vagrant init precise32
vagrant up
4. KM Coffee & Code #3HexBrain team
PuPHPet or Puppet
PuPHPet — це GUI конфігуратор для Vagrant
automation tool. Використовує Puppet для
встановлення та налаштування пакетів
https://puphpet.com/
5. KM Coffee & Code #3HexBrain team
Що таке Puppet
Дозволяє керувати налаштуванням
програмного забезпечення та самої ОС
Як і Vagrant написаний на Ruby.
Альтернативи: Ansible (Python), Chef (Ruby)
6. KM Coffee & Code #3HexBrain team
Vagrant & PuPHPet
Як це працює
configValues = YAML.load_file("#{dir}/puphpet/config.yaml")
7. KM Coffee & Code #3HexBrain team
PuPHPet. Кінець всім сподіванням
Що робити коли в GUI списку PuPHPet’у
немає потрібного пакету?
9. KM Coffee & Code #3HexBrain team
На прикладі NodeJS
1. puphpet/puppet/Puppetfile
mod 'nodejs', :git => 'https://github.com/willdurand/puppet-nodejs.git'
2. puphpet/puppet/manifest.pp
class { 'nodejs':
version => 'stable',
target_dir => '/bin',
}
3. vagrant provision
10. KM Coffee & Code #3HexBrain team
Життя після `vagrant up`
1. /etc/hosts
2. vagrant ssh
3. DB connect
4. Xdebug
11. KM Coffee & Code #3HexBrain team
Плюси та мінуси
+ Гнучкість конфігурації
+ Портативність
+ Швидкість налаштування,
переналаштування
+ Тестування коду з
різними версіями софту
(PHP 5.4, 5.5, 5.6)
- Швидкість
- Дисковий простір на кожну
віртуальну машину (2-5 Гб)
12. KM Coffee & Code #3HexBrain team
Links
http://vagrantup.com/
http://vagrantcloud.com/
http://puppetlabs.com/
http://puphpet.com/
13. KM Coffee & Code #3HexBrain team
Дякуємо за увагу!
14. KM Coffee & Code #3HexBrain team
Live Session!