Created
December 21, 2018 08:31
-
-
Save vahanNasibyan/bd2244eeb9a36e523d09b70bebec5ada to your computer and use it in GitHub Desktop.
This file contains hidden or 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: | |
custom: # Pipelines that can only be triggered manually | |
from-commit: | |
- step: | |
#python image with aws-cli installed | |
image: atlassian/pipelines-awscli | |
services: | |
- docker | |
script: | |
# aws login | |
- eval $(aws ecr get-login --region ${AWS_DEFAULT_REGION} --no-include-email) | |
# docker | |
- export BUILD_ID=custom.${BITBUCKET_COMMIT} | |
- docker build -t ${AWS_REGISTRY_URL}:$BUILD_ID . | |
- docker push ${AWS_REGISTRY_URL}:$BUILD_ID | |
tags: # add the 'tags' section | |
release-*: # specify the tag | |
- step: # define the build pipeline for the tag | |
#python image with aws-cli installed | |
image: atlassian/pipelines-awscli | |
services: | |
- docker | |
script: | |
# aws login | |
- eval $(aws ecr get-login --region ${AWS_DEFAULT_REGION} --no-include-email) | |
# docker | |
- export BUILD_ID=${BITBUCKET_TAG} | |
- docker build -t ${AWS_REGISTRY_URL}:$BUILD_ID . | |
- docker push ${AWS_REGISTRY_URL}:$BUILD_ID | |
hotfix-*: # specify the tag | |
- step: # define the build pipeline for the tag | |
#python image with aws-cli installed | |
image: atlassian/pipelines-awscli | |
services: | |
- docker | |
script: | |
# aws login | |
- eval $(aws ecr get-login --region ${AWS_DEFAULT_REGION} --no-include-email) | |
# docker | |
- export BUILD_ID=${BITBUCKET_TAG} | |
- docker build -t ${AWS_REGISTRY_URL}:$BUILD_ID . | |
- docker push ${AWS_REGISTRY_URL}:$BUILD_ID | |
feature-*: # specify the tag | |
- step: # define the build pipeline for the tag | |
#python image with aws-cli installed | |
image: atlassian/pipelines-awscli | |
services: | |
- docker | |
script: | |
# aws login | |
- eval $(aws ecr get-login --region ${AWS_DEFAULT_REGION} --no-include-email) | |
# docker | |
- export BUILD_ID=${BITBUCKET_TAG} | |
- docker build -t ${AWS_REGISTRY_URL}:$BUILD_ID . | |
- docker push ${AWS_REGISTRY_URL}:$BUILD_ID | |
branches: | |
master: | |
- step: | |
#python image with aws-cli installed | |
image: atlassian/pipelines-awscli | |
services: | |
- docker | |
script: | |
# aws login | |
- eval $(aws ecr get-login --region ${AWS_DEFAULT_REGION} --no-include-email) | |
# docker | |
- export BUILD_ID=$BITBUCKET_BRANCH.$BITBUCKET_COMMIT | |
- export BUILD_LATEST=$BITBUCKET_BRANCH.latest | |
- 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}:$BUILD_LATEST | |
- docker push ${AWS_REGISTRY_URL}:$BUILD_LATEST | |
stage: | |
- step: | |
#python image with aws-cli installed | |
image: atlassian/pipelines-awscli | |
services: | |
- docker | |
script: | |
# aws login | |
- eval $(aws ecr get-login --region ${AWS_DEFAULT_REGION} --no-include-email) | |
# docker | |
- export BUILD_ID=$BITBUCKET_BRANCH.$BITBUCKET_COMMIT | |
- export BUILD_LATEST=$BITBUCKET_BRANCH.latest | |
- 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}:$BUILD_LATEST | |
- docker push ${AWS_REGISTRY_URL}:$BUILD_LATEST | |
develop: | |
- step: | |
#python image with aws-cli installed | |
image: atlassian/pipelines-awscli | |
services: | |
- docker | |
script: | |
# aws login | |
- eval $(aws ecr get-login --region ${AWS_DEFAULT_REGION} --no-include-email) | |
# docker | |
- export BUILD_ID=$BITBUCKET_BRANCH.$BITBUCKET_COMMIT | |
- export BUILD_LATEST=$BITBUCKET_BRANCH.latest | |
- 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}:$BUILD_LATEST | |
- docker push ${AWS_REGISTRY_URL}:$BUILD_LATEST | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment