Skip to content

Commit

Permalink
Update docker 'latest' tagging
Browse files Browse the repository at this point in the history
  • Loading branch information
tsandall committed Mar 7, 2017
1 parent 78d0720 commit a38141b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
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
}

0 comments on commit a38141b

Please sign in to comment.