Created
May 6, 2024 09:18
`buildspec.yml` for ECS Blue/Green
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: 0.2 | |
phases: | |
pre_build: | |
commands: | |
- echo "Logging into AWS ECR" | |
- aws ecr get-login-password --region ap-northeast-2 | docker login --username AWS --password-stdin 730335333809.dkr.ecr.ap-northeast-2.amazonaws.com | |
build: | |
commands: | |
- echo "building docker image" | |
- docker build -t inflearn_docker . | |
- docker tag inflearn_docker:latest 730335333809.dkr.ecr.ap-northeast-2.amazonaws.com/inflearn_docker:latest | |
post_build: | |
commands: | |
- echo "pushing docker image to AWS ECR" | |
- docker push 730335333809.dkr.ecr.ap-northeast-2.amazonaws.com/inflearn_docker:latest | |
- echo "writing image definitions" | |
- printf '[{"name":"inflearn_docker","imageUri":"730335333809.dkr.ecr.ap-northeast-2.amazonaws.com/inflearn_docker:latest"}]' > imagedefinitions.json | |
artifacts: | |
files: | |
- imagedefinitions.json | |
- taskdef.json | |
- appspec.yaml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment