Skip to content

Commit

Permalink
.travis.yml: set go_import_path, use deploy feature
Browse files Browse the repository at this point in the history
When pushing a PR to _my_ remote (github.com/ME), travis will send me an
email saying that it failed to build, and keeps failing, for every
update of the branch[1].

Setting this go_import_path properly should fix the build issue.

Furthermore, having successfully tested the package, our .travis.yml
used to check if this was a PR (it's not, in the context of a branch
pushed to a fork), and did some docker image related tasks. This is done
using the deployment feature of travis now.[2]

[1]: https://travis-ci.com/srenatus/opa/builds/86468169
[2]: https://docs.travis-ci.com/user/deployment

Signed-off-by: Stephan Renatus <srenatus@chef.io>
  • Loading branch information
srenatus authored and tsandall committed Oct 3, 2018
1 parent 838778f commit 4301f29
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 25 deletions.
20 changes: 13 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
sudo: required
language: go
go_import_path: github.com/open-policy-agent/opa
go:
- "1.10"
env:
Expand All @@ -8,10 +9,15 @@ env:
- secure: Oi8pwShwTKnBVQtb9WoCrZSUZbDWXwO4383S6F8/USUASE/r06Zxws0XombEsy7dlG1YBS/3aLLGe5/5umrYu8XlKa0C5f1k+1ABroxQIDaiOoHJLmCTlCW0mDcbAH+THiKriPnULBnCk9qGCVofWDObPqGIIgeE5tHGm8kdfgx0hmuX5XxbZEDStSTh0eag3MFC0AdLqm4LYMaqHs56om976DmxKiO9FvkDhTSUhXsOjcgXnKoneBbzbf+1RnAr2QvuRaHS8nSZEcFnHiWNjGD/ag6Cvd2T4Aa8r5LasdYr9sx93GDteaZiyJmT4zTce4ote2kzddcEdAfK93ERUPiNXBvf0jMrqaVzbx6yI9EdcNvHRA5LARSxkT7CrOA/BjYeP+HuCjW6BJVmstDR9kFL2GoQSZJtrlI2KvHM6H3WWAMYpOCekaYKlxNa6KFoi/4RZbptJj0X5999G3qccBocfs133YQVgSNLrlBQ0KhXw4yMaO7UU8p1m063ls8VWFupWynagWGCrzWGl5w7S0r1YRVUB9kXrUmkRwqtW0niZfM1fX6BKo5PPfql7n0knhjqwo73n3kBuWxfQzYjOACYN3DFPgj0/qaNWR+AvZpqBAE5PyfxccEfpcWUvp2yrfZGuUWV628qPZLA/vQ33iN0lIndK/bCtoz6oqQq9iw=
services:
- docker
after_success:
- source ./build/travis-utils.sh
- 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_release_env; then make tag-latest; fi
- if is_travis_release_env; then make push-latest; fi
deploy:
- provider: script
script: make deploy-travis
on:
repo: open-policy-agent/opa
branch: master
- provider: script
script: make release-travis
on:
repo: open-policy-agent/opa
branch: master
tags: true
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,16 @@ push-latest:
docker push $(IMAGE):latest
docker push $(IMAGE):latest-debug

.PHONY: docker-login
docker-login:
@docker login -u ${DOCKER_USER} -p ${DOCKER_PASSWORD}

.PHONY: deploy-travis
deploy-travis: docker-login image-quick push

.PHONY: release-travis
release-travis: docker-login tag-latest push-latest

.PHONY: install
install: generate
$(GO) install -ldflags $(LDFLAGS)
Expand Down
18 changes: 0 additions & 18 deletions build/travis-utils.sh

This file was deleted.

0 comments on commit 4301f29

Please sign in to comment.