Created
November 5, 2018 10:38
-
-
Save vahanNasibyan/297a257f8e850e735a73f2aea03411da to your computer and use it in GitHub Desktop.
pipelines
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: | |
default: | |
- step: | |
script: | |
- echo "I made a pipeline!" | |
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
Great stuff here, i feel there are better ways to DRY, by making use of anchor features on bitbucket