Skip to content

Commit

Permalink
Merge pull request #32 from kakkoyun/fix_circleci_trigger
Browse files Browse the repository at this point in the history
Only trigger release job for SemVer tags
  • Loading branch information
squat committed May 14, 2020
2 parents 3c24d9b + b26702e commit 1e67f70
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
23 changes: 14 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,6 @@ workflows:
- lint
- test
- generate
tagged-master:
jobs:
- container-release:
filters:
tags:
only: /^v.*/
branches:
only:
- master
commit-master:
jobs:
- build
Expand All @@ -85,3 +76,17 @@ workflows:
branches:
only:
- master
tagged-master:
jobs:
- container-release:
filters:
tags:
# Suggested SemVer regex:
# https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
# https://regex101.com/r/vkijKf/1/
# NOTICE: with an additional "v" as prefix.
only: /v^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/
branches:
only:
- master
- /release-.*/
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,11 @@ container-push: container
docker push $(DOCKER_REPO):latest

.PHONY: container-release
container-release: VERSION_TAG = $(strip $(shell [ -d .git ] && git tag --points-at HEAD))
container-release: container
@docker tag $(DOCKER_REPO):$(VCS_BRANCH)-$(BUILD_DATE)-$(VERSION) $(DOCKER_REPO):$(VERSION)
docker push $(DOCKER_REPO):$(VERSION)
# https://git-scm.com/docs/git-tag#Documentation/git-tag.txt---points-atltobjectgt
@docker tag $(DOCKER_REPO):$(VCS_BRANCH)-$(BUILD_DATE)-$(VERSION) $(DOCKER_REPO):$(VERSION_TAG)
docker push $(DOCKER_REPO):$(VERSION_TAG)
docker push $(DOCKER_REPO):latest

.PHONY: integration-test-dependencies
Expand Down

0 comments on commit 1e67f70

Please sign in to comment.