Skip to content

Commit

Permalink
Merge pull request #179 from crf-devs/protect_tag_build
Browse files Browse the repository at this point in the history
Protect tag builds
  • Loading branch information
mRoca authored Mar 29, 2020
2 parents 0177ab3 + 2f92e8e commit d037161
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@ build:master:
build:tag:
extends: .build
after_script:
- test -z "$CI_COMMIT_TAG" && echo "This is not a tag pipeline" && exit 0
- test -z "$CI_COMMIT_TAG" && echo "This is not a tag pipeline" && exit 1
- echo "Tag => $CI_COMMIT_TAG"
- git branch --contains $(git rev-list -n 1 ${CI_COMMIT_TAG}) --format "%(refname:short)" | grep '^master$' || (echo "The tag is not present on master" && exit 1)
- docker tag ${CI_REGISTRY_IMAGE}/fpm:${CI_COMMIT_REF_SLUG} ${CI_REGISTRY_IMAGE}/fpm:release-latest && docker push ${CI_REGISTRY_IMAGE}/fpm:release-latest
- docker tag ${CI_REGISTRY_IMAGE}/nginx:${CI_COMMIT_REF_SLUG} ${CI_REGISTRY_IMAGE}/nginx:release-latest && docker push ${CI_REGISTRY_IMAGE}/nginx:release-latest
only:
Expand Down

0 comments on commit d037161

Please sign in to comment.