Lock in $30 Savings on PRO—Offer Ends Soon! ⏳

AWS CodeBuild introduction

Yusuke Wada
February 10, 2017

AWS CodeBuild introduction

AWS CodeBuild introduction - AWS CodeBuildのご紹介。re:Invent2016で発表されたAWSの新サービス、AWS CodeBuildについての紹介と、使い方の説明をしています。

Yusuke Wada

February 10, 2017
Tweet

More Decks by Yusuke Wada

Other Decks in Technology

Transcript

  1. ͱ͋ΔΞϓϦέʔγϣϯͷϏϧυϓϩηε 1. Unit TestͷͨΊʹϞοΫαʔϏεΛΠϯετʔϧ͢Δ 2. ςετΛ࣮ߦ͢Δ 3. ੒Ռ෺Λੜ੒͢ΔεΫϦϓτ͕RakefileͳͷͰrubyΛΠϯετʔϧ 4. rake࣮ߦ

    5. ੜ੒͞Εͨ੒Ռ෺ΛS3ʹΞοϓϩʔυ͢ΔͨΊawsΫϥΠΞϯτΛಋೖ 6. S3΁ͷΞοϓϩʔυͷͨΊʹΞΫηεΩʔΛઃఆ 7. S3΁Ξοϓϩʔυ 4
  2. 1. Unit TestͷͨΊʹϞοΫαʔϏεΛΠϯετʔϧ͢Δ 2. ςετΛ࣮ߦ͢Δ 3. ੒Ռ෺Λੜ੒͢ΔεΫϦϓτ͕RakefileͳͷͰrubyΛΠϯετʔϧ 4. rake࣮ߦ 5.

    ੜ੒͞Εͨ੒Ռ෺ΛS3ʹΞοϓϩʔυ͢ΔͨΊawsΫϥΠΞϯτΛಋೖ 6. S3΁ͷΞοϓϩʔυͷͨΊʹΞΫηεΩʔΛઃఆ 7. S3΁Ξοϓϩʔυ ͱ͋ΔΞϓϦέʔγϣϯͷϏϧυϓϩηε 5 Ϗϧυϓϩηεͷ ଟ༷ԽɾෳࡶԽ
  3. AWS͸ɺϏϧυαʔϏε͚͕ͩͳ͔ͬͨ AWS CodePipeline: How to Create a Custom Action –

    Linux Academy Blog https://linuxacademy.com/blog/amazon-web-services-2/aws-codepipeline-how-to-create-a-custom-action/
  4. AWS͸ɺϏϧυαʔϏε͚͕ͩͳ͔ͬͨ AWS CodePipeline: How to Create a Custom Action –

    Linux Academy Blog https://linuxacademy.com/blog/amazon-web-services-2/aws-codepipeline-how-to-create-a-custom-action/
  5. 1ϲ݄ͷྉۚࢼࢉ - CodeBuild • medium Λબ୒ • 0.01$/min × (

    5mim × (100 * 30) ) = 150 $ • $150 per month 20
  6. ϏϧυϓϩδΣΫτΛ࡞੒͢Δ • Environmentɿ
 ϏϧυίϚϯυ͕ϓϦΠϯε τʔϧ͞Εͨαʔό·ͨ͸ Dockerίϯςφ্Ͱ࣮ࢪ 24 Build Environment Reference

    for AWS CodeBuild http://docs.aws.amazon.com/ ja_jp/codebuild/latest/userguide/build- env-ref.html • Artifactsɿ
 ੒Ռ෺ΛS3ʹஔ͘Α͏ʹ͢Δ
  7. ϏϧυϓϩδΣΫτΛ࡞੒͢Δ • Service roleɿ
 Ϗϧυ࣮ߦ࣌ͷIAMϩʔϧΛ બ୒ • Advances settingsɿ
 λΠϜΞ΢τ


    ܭࢉػλΠϓ
 ؀ڥม਺
 ͳͲΛઃఆ͢Δ • ͜ΕͰϏϧυϓϩδΣΫτ͕ ׬੒ 25
  8. buildspec.yml • installɿ
 ςετͰར༻͢ΔɺϩʔΧϧαʔϏ εͳͲΛΠϯετʔϧ͢Δ • pre_buildɿ
 ϏϧυલͷαʔϏεىಈॲཧ • buildɿ


    Ϗϧυɾςετ࣮ߦ • post_buildɿ
 ੒Ռ෺ͷ࡞੒΍௨஌ͳͲ • buildspec.yml΋ҰॹʹϦϙδτϦ ΁PUSH 27
  9. AWS CodeBuildͷ஫ҙ఺ • ౦ژϦʔδϣϯະରԠ 
 EU (Ireland), US East (N.Virginia),

    US East (Ohio)US, West (Oregon) • iOS / MacΞϓϦ ͷϏϧυ͸ະରԠ • ແྉར༻࿮ 100෼ ͸ build.general.small ͷλΠϓͷΈ • Ϗϧυ؀ڥʹ Docker ΠϝʔδΛࢦఆͨ͠৔߹ɺENTRYPOINT, CMD ͕ಈ࡞͠ͳ͍ʢແࢹ͞ΕΔʁʣ 33
  10. ݁࿦1ɿTravisCI, CircleCI͔Β৐Γ׵͔͑ͯͭ͏ • ·ͩ͋ΘͯΔΑ͏ͳ࣌ؒ͡Όͳ͍ • ΍ΔͳΒνʔϜશһΛ׬શʹ৐Γ׵͍͑ͨ • Mac, iOS ϏϧυʹରԠ͢ΔͱҰؾʹՃ଎ͦ͠͏

    • ϏϧυεςʔλεͷύϒϦοΫAPI͕ཉ͍͠ʢAPI Gateway + AWS Lambda + AWS CodeBuild API + S3 Ͱ΍Ζ͏ͱࢥ͑͹Ͱ͖Δʁʣ • ౦ژϦʔδϣϯʹ͖ͨΒຊؾͩ͢ 34
  11. ࢀߟ • AWS CodeBuild Documentation - https://aws.amazon.com/jp/ documentation/codebuild/ • CodeBuild

    ʛ ಛूΧςΰϦʔ ʛ Developers.IO http:// dev.classmethod.jp/referencecat/aws-codebuild/ 36