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

Vagrant と Chef でつくるはてなブックマークの開発環境

aereal
November 25, 2013

Vagrant と Chef でつくるはてなブックマークの開発環境

aereal

November 25, 2013
Tweet

More Decks by aereal

Other Decks in Programming

Transcript

  1. Vagrant ͱ Chef Ͱͭ͘Δ
    ͸ͯͳϒοΫϚʔΫͷ!
    ։ൃ؀ڥ
    id:aereal

    View full-size slide

  2. ΞδΣϯμ
    •͸ͯͳϒοΫϚʔΫ։ൃ؀ڥͷ͜Ε·Ͱ
    •Vagrant + Chef ʹΑΔ࣮ࡍͷӡ༻ͱ՝୊

    View full-size slide

  3. ࠓ೔͠ͳ͍࿩
    •Vagrant ͱ͸?
    •Chef ͱ͸?
    •(Carton ͱ͸?)

    View full-size slide

  4. aereal
    aereal
    aereal.org

    View full-size slide

  5. • αʔόαΠυ (Perl)
    • ΫϥΠΞϯταΠυ
    (JavaScript)
    !
    !
    • αʔόαΠυ (Perl)
    • ϒϥ΢β֦ு
    (JavaScript)
    • ։ൃج൫ͷ੔උ
    • Jenkins, Plack, etc.

    View full-size slide

  6. ͸ͯͳϒοΫϚʔΫ
    • αʔϏε։࢝
    (2005೥2݄ʙ)
    • ϦχϡʔΞϧ
    (2008೥11݄)

    View full-size slide

  7. ͸ͯͳϒοΫϚʔΫ (2)
    • Ridge (ࣗࣾ੡WAF)
    • DBIx::MoCo
    (ࣗࣾ੡O/R mapper)
    • mod_perl2
    • nginx + Apache

    View full-size slide

  8. ͸ͯͳϒοΫϚʔΫ (3)
    • >= 30000 commits
    • >= 7000 files
    • >= 50 contributors
    2008೥2݄ʙ

    View full-size slide

  9. ͸ͯͳϒοΫϚʔΫ!
    ։ൃ؀ڥͷ͜Ε·Ͱ

    View full-size slide

  10. ෳࡶͳґଘؔ܎

    View full-size slide

  11. →ґଘͷղܾ

    View full-size slide

  12. ຊ൪
    •Chef
    •RPM
    ։ൃ
    •cpanm
    •Homebrew
    •apt
    •yum

    View full-size slide

  13. ຊ൪
    •CentOS
    ։ൃ
    •OS X
    •Windows
    •Linux (Debian)

    View full-size slide

  14. ͱΓ͋͑ͣ
    cpanm --installdeps .

    View full-size slide

  15. ͳΜ͔ࣦഊ͢Δ

    View full-size slide

  16. cpanm --installdeps .

    View full-size slide

  17. ͳΜ͔ࣦഊ͢Δ

    View full-size slide

  18. cpanm \
    --installdeps .

    View full-size slide

  19. ͳΜ͔ࣦഊ͢Δ

    View full-size slide

  20. ͳΜͱ͔͢Δ

    View full-size slide

  21. A. จॻΛ࢒͢

    View full-size slide

  22. • ίʔυ΍ίϛοτʹ
    දΕͳ͍΋ͷ
    • ܦҢ
    • จ຺
    !
    !
    • ʮ݁ہͲ͏͢Ε͹͍͍
    ͔ʯ͸ԕ͍
    • Ϟνϕʔγϣϯͷফඅ
    • Ϟνϕʔγϣϯ͸༗
    ݶ
    • ʮͱʹ͔͘ؤுΔʯ

    View full-size slide

  23. A. ϓϩάϥϚϒϧͳ
    ηοτΞοϓํ๏

    View full-size slide

  24. • ୯७࡞ۀͷੵΈॏͶ
    • ΦϓγϣϯҾ਺ͷ
    ࢼߦࡨޡͱ͔
    • ϩά͕࢒Δ
    • յΕͨΒ͙͢ʹΘ͔Δ
    !
    • ෳࡶ͞Λ࣋ͪࠐΉ
    • ֶशίετ
    • ϝϯςφϯείετ

    View full-size slide

  25. http://vagrantup.com/

    View full-size slide

  26. •VM Λ্ཱͪ͛Δ
    •(Ҏલʹ΋΍͍ͬͯͨ)
    •ϋʔυ΢ΣΞ΋ਐԽ͕ͨ͠……

    View full-size slide

  27. http://www.opscode.com/chef/

    View full-size slide

  28. ୮ਫ਼͜Ίͯ࡞ͬͨ VM Πϝʔδ

    View full-size slide

  29. ୮ਫ਼͜Ίͯ࡞ͬͨ VM Πϝʔδ
    R.I.P.

    View full-size slide

  30. Vagrant!
    ʢόουʣϊ΢ϋ΢

    View full-size slide

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

    View full-size slide

  32. •perl-build Ͱ Perl 5.8.8 ΛೖΕΔ
    •tokuhirom/perl-build
    •CPAN Ϟδϡʔϧ͸ Cookbook ʹهड़
    •όʔδϣϯΛࢦఆͯ͠Πϯετʔϧ͢Δ
    LWRP
    •ผʹ Carton Խ΋ਐΊ͍ͯΔ

    View full-size slide

  33. • ./bin/server
    • vagrant up
    • vagrant ssh-config --host vagrant
    > .ssh_config
    • ssh "cd /repos; perl server.up $@"

    View full-size slide

  34. •VM Λ্ཱͪ͛ͯ
    •ssh_config Λͭͬͯ͘
    •SSH Ͱήετ OS ্ͰεΫϦϓτΛ࣮ߦ
    •Proclet

    View full-size slide

  35. ͙͢ʹ։ൃ͍ͨ͠!!!

    View full-size slide

  36. •provisioning ·Ͱࡁ·ͤͨ box Λ഑Δ
    •ࣾ಺ϑΝΠϧαʔό
    •FTP ΞΫηε΋Մ

    View full-size slide

  37. •ೋॏ؅ཧͳͷ͸ͦͷ··
    •→ຊ൪ʹద༻͞ΕΔChefϨγϐͱ࿈ܞ
    •ϝϯς͍ͯ͠Δͷ͸ࣗ෼͚ͩ
    •→஌ݟΛ޿Ί͍͖͍ͯͨ

    View full-size slide

  38. ͳʹ͸ͱ΋͋Ε

    View full-size slide

  39. Vagrant + Chef ࠷ߴ!

    View full-size slide

  40. Vagrant + Chef ࠷ߴ?

    View full-size slide

  41. NOT ۜͷ஄ؙ

    View full-size slide

  42. •όʔδϣϯ੍໿͕ڧ͍
    •CPAN Ϟδϡʔϧ
    •ϛυϧ΢ΣΞ
    •৽ͨʹ։ൃʹࢀՃ͢Δਓ͕Ұఆ਺͍Δ
    •Πϯλʔϯ
    •ҟಈ

    View full-size slide

  43. ࢖Θͣʹ͢Ήͷ͕ཧ૝

    View full-size slide

  44. •Carton
    •plenv / perlbrew
    •(Chef Solo)

    View full-size slide

  45. ෳࡶ͞ͷ୅ঈΛ͸͔Δ

    View full-size slide