Slide 1

Slide 1 text

PHPͰCI/CD ࢲ͸࠷ۙ͜Μͳײ͡Ͱ΍ͬͯ·͢ Θͨͳ΂@kaz_29 @PHPΧϯϑΝϨϯε๺ւಓ 2019

Slide 2

Slide 2 text

WHO? ౉ลҰ޺(@kaz_29) גࣜձࣾϋʔτϏʔπ ։ൃࣄۀ෦ WebΞϓϦέʔγϣϯͷ։ൃ iOS/AndroidΞϓϦέʔγϣϯͷ։ൃ Ϋϥ΢υΠϯϑϥͷߏஙɾӡ༻

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

#hbSAKABA podcast΍ͬͯ·͢

Slide 6

Slide 6 text

ΑΖ͘͠ ͓ئ͍͠·͢

Slide 7

Slide 7 text

PHPͰCI/CD

Slide 8

Slide 8 text

Q?

Slide 9

Slide 9 text

Q CIΛ࣮ફ͍ͯ͠Δਓ?

Slide 10

Slide 10 text

Q CDΛ࣮ફ͍ͯ͠Δਓ?

Slide 11

Slide 11 text

CI ܧଓతΠϯςάϨʔγϣϯ

Slide 12

Slide 12 text

XP - ։ൃͷϓϥΫςΟε • ςετۦಈ։ൃ • ϖΞϓϩάϥϛϯά • ϦϑΝΫλϦϯά • ιʔείʔυͷڞಉॴ༗ • ܧଓతΠϯςάϨʔγϣϯ • YAGNI

Slide 13

Slide 13 text

ܧଓతΠϯςάϨʔγϣϯ • ιʔείʔυ͕मਖ਼͞ΕΔͨͼʹϏϧυΛ࣮ߦ • ςετΛࣗಈ࣮ߦ͠GREENͳঢ়ଶΛอͭ • Ϗϧυઐ༻ͷػࡐ΍αʔϏεΛ࢖͏ • ϝτϦοΫΛऔಘ͢Δ

Slide 14

Slide 14 text

CD ܧଓతσϦόϦʔ

Slide 15

Slide 15 text

ܧଓతσϦόϦʔ CIͰςετ͞Εͨιϑτ΢ΣΞΛ ࣗಈతʹϦϦʔε͢Δ https://www.amazon.co.jp/dp/4048707876

Slide 16

Slide 16 text

ܧଓతσϦόϦʔ • ϓϩδΣΫτ։͔࢝࣌ΒࣗಈԽ͢Δ • ͢΂ͯͷ؀ڥΛಉ͡ํ๏ͰσϓϩΠ͢Δ CDͷϓϩηεࣗମ͕܁Γฦ͠ςετ͞ΕΔ͜ͱʹͳΔ

Slide 17

Slide 17 text

CI/CDΛ࢝ΊΔͨΊʹ • ιʔείʔυͷόʔδϣϯ؅ཧ • σʔλϕʔεϚΠάϨʔγϣϯͷࣗಈԽ • ࣗಈςετ • UnitTest • ݁߹ςετ

Slide 18

Slide 18 text

ͳͥ΍Δͷ͔ʁ

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

https://www.ryuzee.com/contents/blog/6102 https://slide.meguro.ryuzee.com/slides/59

Slide 21

Slide 21 text

িܸΛड͚ͨ

Slide 22

Slide 22 text

ͳͥ΍Δͷ͔ʁ • ҆৺ͯ͠ϦϦʔε͍ͨ͠ • ࣗಈςετ • ୭Ͱ΋ϦϦʔεͰ͖Δ • ૉૣ͘ϦϦʔεͯ͠ϑΟʔυόοΫΛ΋Β͏ • ૉૣ͘վળͯ͠සൟʹϦϦʔε • ΞϓϦͷঢ়ଶΛ೺Ѳ͍ͨ͠ • ςετͷঢ়گΛอଘ • ੩తղੳ݁Ռͷอଘ

Slide 23

Slide 23 text

࣮ફͨ͠ • 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

Slide 24

Slide 24 text

ࢲ͸࠷ۙ͜Μͳײ͡Ͱ ΍ͬͯ·͢

Slide 25

Slide 25 text

#1

Slide 26

Slide 26 text

#1 • Jenkins • εςʔδϯάαʔόʹ͍͋ͷΓ • ઐ༻CIαʔό • Capistrano2 • εςʔδϯάͷΈࣗಈߋ৽ • ։ൃ؀ڥ • Mac্ͷApache/PHP

Slide 27

Slide 27 text

#2

Slide 28

Slide 28 text

#2 • CircleCI(v1) • UnitTest • Capistrano3 • ࣗಈσϓϩΠ͸΍ͬͯͳ͍ • ։ൃ؀ڥ • Vagrant (+Chef solo)

Slide 29

Slide 29 text

#3

Slide 30

Slide 30 text

#3 • CircleCI(v2) • UnitTest • dockerԽ • Ansistrano • ࣗಈσϓϩΠ͸΍ͬͯͳ͍ • ϓϩϏδϣχϯάͱಉ͡πʔϧ • ։ൃ؀ڥ • Vagrant+Ansible local • Docker

Slide 31

Slide 31 text

#4 ʙ ͍·

Slide 32

Slide 32 text

#4 ʙ ͍· AWS CodePipeline Azure DevOps ΋ͪΖΜଞͷαʔϏε΋࢖ͬͯ·͢

Slide 33

Slide 33 text

AWS CodePipeline

Slide 34

Slide 34 text

AWS CodePipeline • AWS͕ఏڙ͢ΔϑϧϚωʔδυͳCI/CDαʔϏε • ෳ਺ͷαʔϏεΛऔΓ·ͱΊΔܗͰߏ੒͞Ε͍ͯΔ CodeCommit / CodeBuild / CodeDeploy • AWSͷαʔϏεͱͷߴ͍਌࿨ੑ

Slide 35

Slide 35 text

No content

Slide 36

Slide 36 text

AWS FargateͰB/G(1) • Cloud Formation • AWS Fargate • Amazon Aurora • AWS CodePipeline

Slide 37

Slide 37 text

https://github.com/aws-samples/ecs-blue-green-deployment/tree/fargate Λϕʔεʹߏங

Slide 38

Slide 38 text

AWS FargateͰB/G(2) • AWS cdk(Cloud Formation) • AWS Fargate • Amazon Aurora • AWS Codepipeline NEW!

Slide 39

Slide 39 text

No content

Slide 40

Slide 40 text

AWS FargateͰB/G(2) • AWS cdkͰߏங • ϦιʔεߏஙͱύΠϓϥΠϯΛ෼཭Ͱ͖ͨ • CloudFormationΛ௚઀࢖Θͳ͍ • ࢖͍׳ΕͨίʔυͰΠϯϑϥΛߏஙͰ͖Δ • IDEͷίʔυิ׬ͷԸܙ

Slide 41

Slide 41 text

Azure DevOps

Slide 42

Slide 42 text

Azure DevOps • MS͕ఏڙ͢ΔϚωʔδυͳCI/CDαʔϏε چVSTSΛࡢ೥Ϧϒϥϯυ • ෳ਺ͷαʔϏεͰߏ੒ Board / Repos / Pipelines / Artifacts • Azureͷ֤छαʔϏεͱͷ਌࿨ੑ

Slide 43

Slide 43 text

No content

Slide 44

Slide 44 text

Azure WebAppͰB/G • Azure WebApp for Containers • Azure Container Registory • Azure Database for PostgreSQL • Azure DevOps

Slide 45

Slide 45 text

Azure WebAppͰB/G

Slide 46

Slide 46 text

Azure AKSͰB/G • Azure Kubernetes Service (AKS) • Azure Container Registory • Azure Database for PostgreSQL • Azure DevOps

Slide 47

Slide 47 text

No content

Slide 48

Slide 48 text

·ͣ͸΍ͬͯΈΑ͏ʂ

Slide 49

Slide 49 text

·ͱΊ

Slide 50

Slide 50 text

·ͱΊ • CI/CDΛߏங͢Δͱ҆৺ͯ͠վળΛਐΊΒΕΔ • ୭Ͱ΋ૉૣ҆͘શʹϦϦʔεͰ͖Δ • ঢ়ଶΛ೺ѲͰ͖ΔΑ͏ʹͳΔ(͠΍͘͢ͳΔ) • ؀ڥ͸࣌୅ͱͱ΋ʹมԽ͍ͯ͘͠ • PaaSͷར༻͕૿͖͑ͯͨ • Ϋϥ΢υϕϯμʔఏڙͷ΋ͷΛ࢖͏ػձ͕૿͑ͨ

Slide 51

Slide 51 text

͓͠·͍ ͜Μͳ෩ʹ΍ͬͯΔͱ͔ɺ͜ΜͳࠔΓࣄ͕͋Δͱ͔ੋඇฉ͔͍ͤͯͩ͘͞ʂ