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

2019/02/27 PHP勉強会 #135 PHPでCI・CD

Kaz Watanabe
February 27, 2019

2019/02/27 PHP勉強会 #135 PHPでCI・CD

Kaz Watanabe

February 27, 2019
Tweet

More Decks by Kaz Watanabe

Other Decks in Technology

Transcript

  1. @ k a z _ 2 9 2 0 1

    9 / 2 / 2 7 @ p h p ษ ڧ ձ # 1 3 5 P H P Ͱ C I / C D ʙ ࠷ ۙ ͜ Μ ͳ ײ ͡ Ͱ ΍ ͬͯ · ͢
  2. P o d c a s t ࢝ Ί ·

    ͠ ͨ ʂ #hbsakaba
  3. – J O H N N Y A P P

    L E S E E D “we are hiring”
  4. C I / C D • CI - Continuous Integration

    • ܧଓతΠϯςάϨʔγϣϯ • CD - Continuous Delivery • ܧଓతσϦόϦʔ
  5. Q u e s t i o n ? C

    I / C D ࣮ ફ ͯ͠ ͍ Δ ํ
  6. ࣮ ફ ͠ ͨ • 2012-10-01 - CakePHP2࣮ફೖ໳͕Ͱ·ͨ͠(deployͷষΛॻ͍ͨ) • http://kaz29.hatenablog.com/entry/2012/10/01/100150

    • 2012-10-30 - ࠓ࣌ͳCakePHPͰͷ։ൃ؀ڥʂʁ • http://kaz29.hatenablog.com/entry/2012/11/30/173424 • 2013-04-30 - ʮCIΛ൒೥ؒ·Θͯ͠Έͯʯͱ͍͏͓୊ͰLTΛ͖ͯ͠·ͨ͠ • http://kaz29.hatenablog.com/entry/2013/04/30/122642 • 2013-04-30 - ʮCakePHPͰֶͿܧଓతΠϯςάϨʔγϣϯʯ- CakePHPΛ࢖ͬͯܧଓ తΠϯςάϨʔγϣϯΛ࣮ફ͢Δͳ͕ΕΛղઆͨ͠ॻ੶͕ग़൛͞Ε·͢ • http://kaz29.hatenablog.com/entry/2014/09/03/095358
  7. # 1

  8. # 1 • Jenkins • εςʔδϯάαʔόʹ͍͋ͷΓ • ઐ༻CIαʔό • Capistrano2

    • εςʔδϯά͸ࣗಈߋ৽ • ։ൃ؀ڥ • Mac্ͷApache/PHP
  9. # 2

  10. # 3

  11. # 2 • CircleCI(v1) • UnitTest • dockerԽ • Ansistrano

    • ࣗಈσϓϩΠ͸΍ͬͯͳ͍ • ϓϩϏδϣχϯάͱಉ͡πʔϧ • ։ൃ؀ڥ • Vagrant+Ansible • Docker
  12. A W S C o d e P i p

    e l i n e • Docker imageͷbuild • ECR΁ͷPush • Deploy • ECS(Fargate)΁ͷB/G deploy • खಈapproveͰB/GΛswap
  13. A W S C o d e P i p

    e l i n e https://docs.aws.amazon.com/ja_jp/codebuild/latest/userguide/sample-docker.html buildspec.yml sample
  14. A z u re D e v O p s

    • Visual Studio Team ServicesʢVSTSʣΛϦϒϥϯυͯ͠࠶ߏஙͨ͠αʔϏε • ։ൃऀ5໊·Ͱ͸ແྉͰ࢖͑Δ(10Ϣʔβ ¥3,360/݄) • Ұݸͷδϣϒ (1,800෼/݄·Ͱ) • ͔Μ͹ΜϘʔυ • GitϦϙδτϦແ੍ݶ(Githubͱ΋࿈ܞՄೳ) • ؔ܎ऀແ੍ݶ(ϦϙδτϦ͸ݟΕͳ͍) • Visual Studio αϒεΫϥΠόʔ͸Χ΢ϯτ͞Εͳ͍
  15. A z u re D e v O p s

    • Azure Boards -> ͔Μ͹ΜϘʔυ • Azure Pipelines -> CI/CDͷ࣮ߦϓϥοτϗʔϜ • Azure Repos -> Git ϦϙδτϦ • Azure Test Plans -> ୳ࡧςετ(?) • Azure Artifacts -> ύοέʔδϦϙδτϦ
  16. A z u re D e v O p s

    • Git repository • ͔Μ͹ΜϘʔυ • Build pipeline • UnitTest • Docker imageͷbuild • ACR΁ͷpush • AKS΁ͷB/G deploy • खಈapproveͰGreenΛstage
  17. S A M P L E Azure DevOps + Azure

    Kubernetes Service(AKS)
  18. · ͱ Ί • CI/CD؀ڥͷӡ༻͸݁ߏେม • ࡞Γͬͺͳ͠ʹ͢Δͱࢮ͵ • ཁ݅తʹڐ͢ͳΒSaaSָ͕ •

    Ϋϥ΢υϕϯμඪ४ͷ΋ͷΛ࢖͏ͱศར • ݸਓతʹAzure DevOpsΦεεϝ
  19. ࠙ ਌ ձ Ͱ օ ͞ Μ Ͳ Μ ͳ

    ײ ͡ ͔ ੋ ඇ ฉ ͔ ͤ ͯ͘ ͩ ͞ ͍ ʂ ͓͠·͍