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

AWSで構築するDocker環境CI/CD | POST URBAN.inc 難波 啓司

KEIJI NAMBA
January 26, 2021

AWSで構築するDocker環境CI/CD | POST URBAN.inc 難波 啓司

KEIJI NAMBA

January 26, 2021
Tweet

Other Decks in Programming

Transcript

  1. Code Pipeline Code Build ECS Github Integration ECR Push Images

    Update Task Definition Build Test Push Build docker images. Run tests. Push docker images to ECR. Architecture
  2. version: 0.2 phases: install: runtime-versions: docker: 18 pre_build: commands: -

    aws --version - $(aws ecr get-login --region $AWS_DEFAULT_REGION --no-include-email) - REPOSITORY_URI=000000000000.dkr.ecr.ap-northeast-1.amazonaws.com/example.com/app - COMMIT_HASH=$(echo $CODEBUILD_RESOLVED_SOURCE_VERSION | cut -c 1-7) - IMAGE_TAG=${COMMIT_HASH:=latest} build: commands: - docker-compose -f docker-compose.prd.yml build - docker-compose -f docker-compose.prd.yml run app rails test - docker tag app REPOSITORY_URI:$IMAGE_TAG post_build: commands: - docker push $REPOSITORY_URI:$IMAGE_TAG - printf '[{"name":"app","imageUri":"%s"}]' $REPOSITORY_URI:$IMAGE_TAG > imagedefinitions.json artifacts: files: imagedefinitions.json AWS CLIのログインや変数の セットアップ PRE BUILD Dockerイメージのビルドとテス トの実行 BUILD ECRのレポジトリにビルドした イメージをプッシュ POST BUILD
  3. Code Pipeline Code Build ECS Github Integration ECR Push Images

    Update Task Definition Build Test Push Build docker images. Run tests. Push docker images to ECR. Architecture
  4. CREDITS: This presentation template was created by Slidesgo, including icons

    by Flaticon, and infographics & images by Freepik THANKS Do you have any questions? [email protected] 070-1877-9900 https://post-urban.co