-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #83 from zalando-stups/58-auto-versions-with-travis
#58 switching to a more manual way, but without pitfalls
- Loading branch information
Showing
2 changed files
with
41 additions
and
30 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,8 +5,6 @@ docker_tag ?= zalando-stups/skrop | |
|
||
CURRENT_VERSION = $(shell git describe --tags --always --dirty) | ||
VERSION ?= $(CURRENT_VERSION) | ||
NEXT_MAJOR = $(shell go run packaging/version/version.go major $(CURRENT_VERSION)) | ||
NEXT_MINOR = $(shell go run packaging/version/version.go minor $(CURRENT_VERSION)) | ||
NEXT_PATCH = $(shell go run packaging/version/version.go patch $(CURRENT_VERSION)) | ||
COMMIT_HASH = $(shell git rev-parse --short HEAD) | ||
|
||
|
@@ -43,36 +41,23 @@ tag: | |
push-tags: | ||
git push --tags https://$(GITHUB_AUTH)@github.com/zalando-stups/skrop | ||
|
||
release-major: | ||
echo Incrementing major version | ||
make VERSION=$(NEXT_MAJOR) tag push-tags | ||
|
||
release-minor: | ||
echo Incrementing minor version | ||
make VERSION=$(NEXT_MINOR) tag push-tags | ||
|
||
release-patch: | ||
echo Incrementing patch version | ||
echo "Incrementing patch version" | ||
make VERSION=$(NEXT_PATCH) tag push-tags | ||
|
||
ci-user: | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Travis CI" | ||
|
||
ci-release-major: ci-user init-deps release-major | ||
ci-release-minor: ci-user init-deps release-minor | ||
ci-release-patch: ci-user init-deps release-patch | ||
|
||
ci-test: | ||
./.travis/test.sh | ||
|
||
ci-trigger: ci-test | ||
ifeq ($(TRAVIS_BRANCH)_$(TRAVIS_PULL_REQUEST)_$(findstring major-release,$(TRAVIS_COMMIT_MESSAGE)), master_false_major-release) | ||
make ci-release-major | ||
else ifeq ($(TRAVIS_BRANCH)_$(TRAVIS_PULL_REQUEST)_$(findstring minor-release,$(TRAVIS_COMMIT_MESSAGE)), master_false_minor-release) | ||
make ci-release-minor | ||
else ifeq ($(TRAVIS_BRANCH)_$(TRAVIS_PULL_REQUEST), master_false) | ||
ifeq ($(TRAVIS_BRANCH)_$(TRAVIS_PULL_REQUEST), master_false) | ||
echo "Merge to 'master'. Tagging patch version up." | ||
make ci-release-patch | ||
else | ||
echo Not a merge to 'master'. Not versionning this merge. | ||
echo "Not a merge to 'master'. Not versionning this merge." | ||
endif |
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