STNSとDocker

1b838da2065660793d5b26f2cdc32de7?s=47 Kazuhiko Yamashita
April 23, 2016
1.1k

 STNSとDocker

1b838da2065660793d5b26f2cdc32de7?s=128

Kazuhiko Yamashita

April 23, 2016
Tweet

Transcript

  1. य़ͷཅؾʹ༠ΘΕͯ STNSͱDocker

  2. hi! GMO Pepabo, Inc. ϗεςΟϯάࣄۀ෦ ϜʔϜʔυϝΠϯάϧʔϓ γχΞΤϯδχΞ @pyama86

  3. STNS ɾLinuxϢʔβʔɺάϧʔϓͷ໊લղܾ ɾSSHϩάΠϯ࣌ͷެ։伴ͷऔಘ ɾSudoύεϫʔυͷೝূ

  4. STNS ɾTOMLܗࣜͷઃఆϑΝΠϧ ɹˠγϯϓϧͳ؅ཧ ɾrhel,debianͷϦϙδτϦఏڙ ɾx86_64,i386ͷαϙʔτ [users.example] id = 1001 group_id

    = 1001 keys = ["ssh-rsa XXXXX…"] [groups.example] id = 1001 users = ["example"]
  5. ෳ਺؀ڥΛαϙʔτ ↓ ӡ༻ෛՙ͕ߴ·Δ

  6. Linuxϛυϧ΢ΣΞͷ৔߹ ɾෳ਺ͷOSɾΞʔΩςΫνϟͰͷಈ࡞Λอূ ɾෳ਺ͷܗࣜͷύοέʔδϯάʹରԠ(rpm,deb) ɾLinuxͷࠜװͷػೳͰ͋ΔͨΊαʔϏεஅ͸ ڐ͞Εͳ͍

  7. ϦϦʔεϑϩʔ 1.push 2.webhook 3.CI 4.test deploy 5.install test 6.integration test

    7.producion deploy
  8. Docker

  9. ϦϦʔεϑϩʔ 1.push 2.webhook 3.CI 4.test deploy 5.install test 6.integration test

    7.producion deploy Docker
  10. ໾ׂ͝ͱʹΠϝʔδΛ෼͚Δ rhel-x86-build rhel-x86-test rhel-x86-pkg rhel-i386-build rhel-i386-test rhel-i386-pkg debian-x86-build debian-x86-test debian-x86-pkg

    debian-i386-build debian-i386-test debian-i386-pkg rhel-x86-chef rhel-i386-chef debian-x86-chef debian-i386-chef 16ύλʔϯ×2(server,client)
  11. DRY

  12. Base STEP1:Πϝʔδ؅ཧΛೋஈ֊ʹ rhel-x86 rhel-i386 debian-i386 debian-x86 Πϯετʔϧ͢Δϛυϧ΢ΣΞ΍ ಺෦ઃఆΛἧ͑ɺΞʔΩςΫνϟ ʹґଘ͠ͳ͍ૢ࡞ΛՄೳͱ͢Δ concreate

    rhel-x86-build rhel-x86-test rhel-x86-pkg rhel-i386-build rhel-i386-test rhel-i386-pkg debian-x86-build debian-x86-test debian-x86-pkg debian-i386-build debian-i386-test debian-i386-pkg ϕʔεΠϝʔδ͔Β໾ׂ͝ͱʹ ΠϝʔδΛ࡞੒͢Δ
  13. STEP2:ERBͰDockerfileͰग़དྷΔ͜ͱΛ૿΍͢ ɾdocker/centos-ci.erb DockerfileͷFROMʹ͸ม਺ΛࢦఆͰ͖ͳ͍ͷͰ ERBͰςϯϓϨʔτԽ͢Δ

  14. STEP3:RakeͰBuild͢Δ ɾRakefile Rake ͸ Ruby Ͱॻ͔ΕͨϏϧυπʔϧɻ ERBͱ߹ΘͤΔ͜ͱͰॏෳΛݮΒ͠ɺλεΫΛఆٛ͢Δ͜ͱ͕ग़དྷ·͢ɻ

  15. Dockerfile rhel-x86-build rhel-x86-test rhel-x86-pkg rhel-i386-build rhel-i386-test rhel-i386-pkg debian-x86-build debian-x86-test debian-x86-pkg

    debian-i386-build debian-i386-test debian-i386-pkg bin/rake build bin/rake test bin/rake pkg ໾ׂ͝ͱʹ1ίϚϯυͰશͯͷOSɺ ΞʔΩςΫνϟͰ࣮ߦͰ͖ΔΑ͏ʹͳΔ
  16. ͞Βʹ

  17. Travis CIͳΒDocker΋ಈ͘ ɾύοέʔδ࡞੒ ɾΠϯετʔϧ ɾServerspecͰల։ޙͷঢ়ଶΛςετ ɹ →ෳ਺ͷOSɺෳ਺ͷΞʔΩςΫνϟΛCI

  18. ࠷ޙʹ ɾDockerΛར༻͢Δͱෳ਺ͷ؀ڥΛखܰʹ४උ͢Δ ͜ͱ͕ग़དྷΔ͕ɺखܰ͞Ώ͑ʹDRYݪଇʹ൓͕ͪ͠ ɾRakeͱ૊Έ߹Θͤɺಉ͡ఆٛΛߦΘͳ͍ ɾϕʔεΠϝʔδͱ۩৅Πϝʔδͷೋஈ֊ʹ෼͚Δ ͜ͱͰπʔϧͱ૊Έ߹Θͤ΍͘͢ͳΔ ɾSTNSɺຊ౰ʹศར͔ͩΒ࢖ͬͨ΄͏͕͍͍

  19. ͓ෲ͍ͨ͢ΆΑ