Last active
June 30, 2022 13:00
-
-
Save toddlers/3f3a1b54254cdf07165d1bd1ba6bc47e to your computer and use it in GitHub Desktop.
bitbucket pipeline with aws credentials
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
pipelines: | |
- step: | |
script: | |
# assuming the base image which is pulled from ecr has aws cli installed | |
- export AWS_PROFILE=deployment | |
# aws login | |
- eval $(aws ecr get-login --region ${AWS_DEFAULT_REGION} --no-include-email) | |
# docker | |
- export BUILD_ID=$BITBUCKET_BRANCH_$BITBUCKET_COMMIT_$BITBUCKET_BUILD_NUMBER | |
- docker build -t ${AWS_REGISTRY_URL}:$BUILD_ID . | |
- docker push ${AWS_REGISTRY_URL}:$BUILD_ID | |
- docker tag ${AWS_REGISTRY_URL}:$BUILD_ID ${AWS_REGISTRY_URL}:development | |
- docker push ${AWS_REGISTRY_URL}:development |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment