Skip to content

Commit

Permalink
travis: Update Travis deployments to support release branches
Browse files Browse the repository at this point in the history
Previously, the Travis configuration would only trigger deployments
for the master branch. Also, the release-travis step would re-tag
:latest which is not what we want for release branches.

These changes add a new Travis deployment for release branches that
does not re-tag :latest and _will_ trigger for tags on release
branches.

Signed-off-by: Torin Sandall <[email protected]>
  • Loading branch information
tsandall committed Jul 3, 2019
1 parent adefa75 commit 90e94bf
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
19 changes: 15 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ services:
deploy:


# This deployment is mutually exclusive with the next deployment. This
# This deployment is mutually exclusive with the other deployments. This
# deployment builds and publishes the docker image whenever changes are
# committed to master. The latest tag is not updated.
- provider: script
Expand All @@ -23,14 +23,25 @@ deploy:
branch: master
tags: false

# This deployment is mutually exclusive with the previous deployment. This
# This deployment is mutually exclusive with the other deployments. This
# deployment builds and publishes the docker image whenver a new tag is
# created. The latest tag is updated to point to the image produced by this
# deployment.
# created on the master branch. The latest tag is updated to point to the
# image produced by this deployment.
- provider: script
skip_cleanup: true # do not delete artifacts because linux executable is needed
script: make release-travis
on:
repo: open-policy-agent/opa
branch: master
tags: true

# This deployment is mutually exclusive with the other deployments. This
# deployment builds and publishes the docker image whenver a new tag is
# created on a release branch.
- provider: script
skip_cleanup: true # do not delete artifacts because linux executable is needed
script: make release-bugfix-travis
on:
repo: open-policy-agent/opa
condition: $TRAVIS_BRANCH =~ ^release-.*$
tags: true
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ deploy-travis: docker-login image-quick push
.PHONY: release-travis
release-travis: deploy-travis tag-latest push-latest

.PHONY: release-bugfix-travis
release-bugfix-travis: deploy-travis

.PHONY: install
install: generate
$(GO) install -ldflags $(LDFLAGS)
Expand Down Expand Up @@ -171,7 +174,7 @@ clean: wasm-clean
rm -fr _test

# The docs-% pattern target will shim to the
# makefile in ./docs
# makefile in ./docs
.PHONY: docs-%
docs-%:
$(MAKE) -C docs $*
Expand Down

0 comments on commit 90e94bf

Please sign in to comment.