Last active
November 20, 2019 06:54
-
-
Save mazhar266/74152156ce98bb133de41ea082ee60ca to your computer and use it in GitHub Desktop.
AWS CodeDeploy buildspec.yml for auto deploying AWS ECS from AWS ECR via AWS CodePipeline
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: | |
install: | |
runtime-versions: | |
python: 3.7 | |
build: | |
commands: | |
- REPOSITORY_URI=$(cat imageDetail.json | python -c "import sys, json; print(json.load(sys.stdin)['ImageURI'].split('@')[0])") | |
- IMAGE_TAG=$(cat imageDetail.json | python -c "import sys, json; print(json.load(sys.stdin)['ImageTags'][0])") | |
- echo $REPOSITORY_URI:$IMAGE_TAG | |
post_build: | |
commands: | |
- echo Writing image definitions file... | |
- printf '[{"name":"task_name_here","imageUri":"%s"}]' $REPOSITORY_URI:$IMAGE_TAG > imagedefinitions.json | |
artifacts: | |
files: imagedefinitions.json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment