Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Vagrant と Chef で プログラマブルな 開発環境をつくる

aereal
September 21, 2013

Vagrant と Chef で プログラマブルな 開発環境をつくる

aereal

September 21, 2013
Tweet

More Decks by aereal

Other Decks in Technology

Transcript

  1. Vagrant ͱ Chef Ͱ ϓϩάϥϚϒϧͳ ։ൃ؀ڥΛͭ͘Δ id:aereal 13೥9݄21೔౔༵೔

  2. id:aereal @aereal aereal aereal.org 13೥9݄21೔౔༵೔

  3. Ruby JavaScript Perl Io Zsh VimScript Lua Go 13೥9݄21೔౔༵೔

  4. Ruby JavaScript Perl Io Zsh VimScript Lua Go 13೥9݄21೔౔༵೔

  5. Web ΞϓϦέʔγϣϯ 13೥9݄21೔౔༵೔

  6. •Model •DBI •View •JSON::XS •Text::Xslate •Controller •(Router::Simple) 13೥9݄21೔౔༵೔

  7. •LWP::UserAgent, Furl •XML::*, YAML::Syck •Email::* •Image::Magick 13೥9݄21೔౔༵೔

  8. ෳࡶͳґଘؔ܎ 13೥9݄21೔౔༵೔

  9. ґଘͷղܾ 13೥9݄21೔౔༵೔

  10. ๭ Web αʔϏε 13೥9݄21೔౔༵೔

  11. OS 13೥9݄21೔౔༵೔

  12. ຊ൪ •CentOS ։ൃ •OS X •Windows •Linux (Debian) 13೥9݄21೔౔༵೔

  13. ߏ੒؅ཧ 13೥9݄21೔౔༵೔

  14. ຊ൪ •Chef •RPM ։ൃ •cpanm •Homebrew •apt •yum 13೥9݄21೔౔༵೔

  15. ͱΓ͋͑ͣ cpanm --installdeps . 13೥9݄21೔౔༵೔

  16. ͳΜ͔ࣦഊ͢Δ 13೥9݄21೔౔༵೔

  17. cpanm --installdeps . 13೥9݄21೔౔༵೔

  18. ͳΜ͔ࣦഊ͢Δ 13೥9݄21೔౔༵೔

  19. cpanm \ --installdeps . 13೥9݄21೔౔༵೔

  20. ͳΜ͔ࣦഊ͢Δ 13೥9݄21೔౔༵೔

  21. ΋͏΍ͩ 13೥9݄21೔౔༵೔

  22. ͳΜͱ͔͢Δ 13೥9݄21೔౔༵೔

  23. จॻΛ࢒͢ 13೥9݄21೔౔༵೔

  24. •ܦҢɺจ຺Λ࢒͢ •ʮ݁ہͲ͏͢Ε͹͍͍͔ʯ͸ԕ͍ •Ϟνϕʔγϣϯͷফඅ •Ϟνϕʔγϣϯ͸༗ݶ •ʮͱʹ͔͘ؤுΔʯ 13೥9݄21೔౔༵೔

  25. ϓϩάϥϚϒϧͳ ηοτΞοϓํ๏ 13೥9݄21೔౔༵೔

  26. •୯७࡞ۀͷੵΈॏͶ •ΦϓγϣϯҾ਺ͷࢼߦࡨޡͱ͔ •ϩά͕࢒Δ •յΕͨ͜ͱ͕͙͢ʹΘ͔Δ 13೥9݄21೔౔༵೔

  27. 13೥9݄21೔౔༵೔

  28. •VM Λ্ཱͪ͛Δ •(Ҏલʹ΋΍͍ͬͯͨ) •ϋʔυ΢ΣΞ΋ਐԽ͕ͨ͠…… 13೥9݄21೔౔༵೔

  29. 13೥9݄21೔౔༵೔

  30. ୮ਫ਼͜Ίͯ࡞ͬͨ VM Πϝʔδ 13೥9݄21೔౔༵೔

  31. ୮ਫ਼͜Ίͯ࡞ͬͨ VM Πϝʔδ R.I.P. 13೥9݄21೔౔༵೔

  32. •NFS ͰήετͱϦϙδτϦΛڞ༗͢Δ •Virtualbox ͷ shared folder ͸஗͍ •࠷େ20ഒ஗͍…… • http://docs-v1.vagrantup.com/v1/docs/nfs.html

    •MySQL ͳͲ͸ Cookbook Λ༻ҙ͢Δ 13೥9݄21೔౔༵೔
  33. •perl-build Ͱ Perl 5.8.8 ΛೖΕΔ •tokuhirom/perl-build •CPAN Ϟδϡʔϧ͸ Cookbook ʹهड़

    •όʔδϣϯΛࢦఆͯ͠Πϯετʔϧ͢Δ LWRP •ผʹ Carton Խ΋ਐΊ͍ͯΔ 13೥9݄21೔౔༵೔
  34. • ./bin/server • vagrant up • vagrant ssh-config --host vagrant

    > .ssh_config • ssh "cd /repos; perl server.up $@" 13೥9݄21೔౔༵೔
  35. •VM Λ্ཱͪ͛ͯ •ssh_config Λͭͬͯ͘ •SSH Ͱήετ OS ্ͰεΫϦϓτΛ࣮ߦ •Proclet 13೥9݄21೔౔༵೔

  36. ͙͢ʹ։ൃ͍ͨ͠!!! 13೥9݄21೔౔༵೔

  37. •provisioning ·Ͱࡁ·ͤͨ box Λ഑Δ •ࣾ಺ϑΝΠϧαʔό •FTP ΞΫηε΋Մ 13೥9݄21೔౔༵೔

  38. http://git.io/PBG-og ※༧ఆ஍ 13೥9݄21೔౔༵೔

  39. ՝୊ 13೥9݄21೔౔༵೔

  40. •ೋॏ؅ཧͳͷ͸ͦͷ·· •ຊ൪ʹద༻͞ΕΔ Chef Ϩγϐͱ࿈ܞ •ϝϯς͍ͯ͠Δͷ͸ࣗ෼͚ͩ •஌ݟΛ޿Ί͍͖͍ͯͨ 13೥9݄21೔౔༵೔

  41. ͳʹ͸ͱ΋͋Ε 13೥9݄21೔౔༵೔

  42. Vagrant + Chef ࠷ߴ! 13೥9݄21೔౔༵೔

  43. Vagrant + Chef ࠷ߴ? 13೥9݄21೔౔༵೔

  44. NOT ۜͷ஄ؙ 13೥9݄21೔౔༵೔

  45. •όʔδϣϯ੍໿͕ڧ͍ •CPAN Ϟδϡʔϧ •ϛυϧ΢ΣΞ •৽ͨʹ։ൃʹࢀՃ͢Δਓ͕Ұఆ਺͍Δ •Πϯλʔϯ •ҟಈ 13೥9݄21೔౔༵೔

  46. ࢖Θͣʹ͢Ήͷ͕ཧ૝ 13೥9݄21೔౔༵೔

  47. •Carton •plenv / perlbrew •(Chef Solo) 13೥9݄21೔౔༵೔

  48. ෳࡶ͞ͷ୅ঈΛ͸͔Ε 13೥9݄21೔౔༵೔

  49. Fin. 13೥9݄21೔౔༵೔