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

CircleCIを導入した話

urmot
January 25, 2019

 CircleCIを導入した話

urmot

January 25, 2019
Tweet

More Decks by urmot

Other Decks in Technology

Transcript

  1. എܠ • ϝσΟΧϧࣄۀ෦ ϦχϡʔΞϧνʔϜ • ։ൃ੹೚ऀ: 1ਓɺΤϯδχΞ: 13ਓ • ໾ׂ͝ͱʹϦϙδτϦΛ෼͚͍ͯΔ(90ݸ͘Β͍)

    • privateͳϥΠϒϥϦ͸ɺpackage഑৴αʔόΛΦϯ ϓϨ্ʹཱͯͯ഑৴͍ͯ͠Δ(satisαʔό) • ఆظతʹεςʔδϯάʹσϓϩΠ • εςʔδϯάσϓϩΠޙɺςελʔ͞Μ͕ಈ࡞֬ೝ
  2. CIಋೖલͷσϓϩΠϑϩʔ ΤϯδχΞ ੹೚ऀ ᶃ Create Pull Request ᶅ ఆظతʹdev ->

    master ᶄ PRग़ͨ͠Αʔ σϓϩΠαʔό ᶆ ssh Deployer ᶈ deploy ᶇ Run deployment ᶈ Wait deployment ᶉ Finish deployment ᶊ exit ᶋ σϓϩΠ௨஌ Staging VPC ςελʔ
  3. Jenkins • ϝϦοτ • ֦ுੑ͕ߴ͘ɺͳΜͰ΋Ͱ͖Δ • ΦϯϓϨ্ʹߏங͢ΔͨΊɺIP͕ݻఆ • هࣄ΋๛෋ •

    σϝϦοτ • αʔόΛ༻ҙ͢Δඞཁ͕͋ΔͨΊอकɾӡ༻͕ඞཁ • ຊ൪ΛؚΊϫʔΫϑϩʔʹ૊ΈࠐΉͨΊɺಋೖ͸ܭըతʹߦ͏ ඞཁ͕͋Δ • ؅ཧΛଵΔͱJobͷৄࡉ͕࡞ͬͨਓ͔͠Θ͔Βͳ͘ͳͬͯ͠·͏
  4. Jenkins • ϝϦοτ • ֦ுੑ͕ߴ͘ɺͳΜͰ΋Ͱ͖Δ • ΦϯϓϨ্ʹߏங͢ΔͨΊɺIP͕ݻఆ • هࣄ΋๛෋ •

    σϝϦοτ • αʔόΛ༻ҙ͢Δඞཁ͕͋ΔͨΊอकɾӡ༻͕ඞཁ • ຊ൪ΛؚΊϫʔΫϑϩʔʹ૊ΈࠐΉͨΊɺಋೖ͸ܭըతʹߦ͏ ඞཁ͕͋Δ • ؅ཧΛଵΔͱJobͷৄࡉ͕࡞ͬͨਓ͔͠Θ͔Βͳ͘ͳͬͯ͠·͏
  5. TravisCI • ϝϦοτ • CloudͰ͋ΔͨΊɺαʔόͷ؅ཧɾӡ༻͸ෆཁ • Githubͱͷ਌࿨ੑߴΊ • هࣄ΋๛෋ •

    σϝϦοτ • ίϯςφʹsshͰೖΕͳ͍ͷͰσόοά͠ʹ͍͘ • $129͕͔͔ΔͨΊɺCIΛ͸͡Ίͯಋೖ͢Δࡍʹ͸ఏҊ͠ʹ͍͘ • CloudͳͷͰϏϧυͷ౓ʹIP͕มΘΔ
  6. TravisCI • ϝϦοτ • CloudͰ͋ΔͨΊɺαʔόͷ؅ཧɾӡ༻͸ෆཁ • Githubͱͷ਌࿨ੑߴΊ • هࣄ΋๛෋ •

    σϝϦοτ • ίϯςφʹsshͰೖΕͳ͍ͷͰσόοά͠ʹ͍͘ • $129͕͔͔ΔͨΊɺCIΛ͸͡Ίͯಋೖ͢Δࡍʹ͸ఏҊ͠ʹ͍͘ • CloudͳͷͰϏϧυͷ౓ʹIP͕มΘΔ
  7. CircleCI • ϝϦοτ • CloudͰ͋ΔͨΊɺαʔόͷ؅ཧɾӡ༻͸ෆཁ • αϙʔτ͕खް͍ • هࣄ΋๛෋ •

    sshͰίϯςφʹೖΕΔͷͰɺσόοά͠΍͍͢ • ແྉͰ࢖͍࢝ΊΒΕΔ • σϝϦοτ • ClouldͳͷͰϏϧυͷ౓ʹຖճIP͕มΘΔ
  8. CircleCI • ϝϦοτ • CloudͰ͋ΔͨΊɺαʔόͷ؅ཧɾӡ༻͸ෆཁ • αϙʔτ͕खް͍ • هࣄ΋๛෋ •

    sshͰίϯςφʹೖΕΔͷͰɺσόοά͠΍͍͢ • ແྉͰ࢖͍࢝ΊΒΕΔ • σϝϦοτ • ClouldͳͷͰϏϧυͷ౓ʹຖճIP͕มΘΔ
  9. CircleCIಋೖޙͷσϓϩΠϑϩʔ σϓϩΠαʔό Deployer Staging VPC ςετ & σϓϩΠ ΤϯδχΞ ੹೚ऀ

    ᶃ Create Pull Request ᶅ Merge ᶄ PRग़ͨ͠Αʔ ᶆ CI Build Start ᶋ ௨஌ ςελʔ ᶇ ᶈ Run Deployer ᶊ Finish Deploy ᶉ deploy