Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docker 'latest' tagging #288

Merged
merged 1 commit into from
Mar 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ after_success:
- if is_travis_push_env; then docker login -u $DOCKER_USER -p $DOCKER_PASSWORD; fi
- if is_travis_push_env; then make image-quick; fi
- if is_travis_push_env; then make push; fi
- if is_travis_push_env; then make tag-latest; fi
- if is_travis_push_env; then make push-latest; fi
- if is_travis_release_env; then make tag-latest; fi
- if is_travis_release_env; then make push-latest; fi
- if is_travis_push_env; then make perf-regression; fi
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ LDFLAGS := "-X github.com/open-policy-agent/opa/version.Version=$(VERSION) \
GO15VENDOREXPERIMENT := 1
export GO15VENDOREXPERIMENT

.PHONY: all deps generate build install test perf perf-regression cover check check-fmt check-vet check-lint fmt clean \
release-builder push-release-builder release release-patch
.PHONY: all build check check-fmt check-lint check-vet \
clean cover deps fmt generate install perf perf-regression \
push push-latest push-release-builder release release-builder \
release-patch tag-latest test version

######################################################
#
Expand All @@ -49,6 +51,9 @@ export GO15VENDOREXPERIMENT

all: deps build test check

version:
@echo $(VERSION)

deps:
@./build/install-deps.sh

Expand Down
10 changes: 10 additions & 0 deletions build/travis-utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,13 @@ function is_travis_push_env() {
fi
return 1
}

# Travis-CI sets TRAVIS_TAG=<tag> when the build is triggered for a tag.
# If the tag matches the source version then we can assume this is build is
# for a release.
function is_travis_release_env() {
if [ "$TRAVIS_TAG" = "$(make version)" ]; then
return 0
fi
return 1
}