forked from open-policy-agent/gatekeeper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
53 lines (51 loc) · 2.21 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
os: linux
language: go
go_import_path: github.com/open-policy-agent/gatekeeper
go:
- "1.13.x"
services:
- docker
jobs:
include:
- stage: "lint, build, unit test, e2e, dev deploy on master, release deploy"
name: "lint, build, unit test, e2e, dev deploy on master, release deploy"
before_script:
- GOLANGCILINT_VERSION=1.21.0
- GO111MODULE=on go get -u github.com/golangci/golangci-lint/cmd/golangci-lint@v${GOLANGCILINT_VERSION}
script:
- make lint
- make e2e-bootstrap
- make e2e-build-load-image IMG=gatekeeper-e2e:latest
- make deploy IMG=gatekeeper-e2e:latest USE_LOCAL_IMG=true
- make test-e2e
- echo -e '\n\n======= manager logs =======\n\n' && kubectl logs -n gatekeeper-system -l control-plane=controller-manager
deploy:
- provider: script
script: make docker-login && make docker-push-dev IMG=gatekeeper-e2e:latest
on:
repo: open-policy-agent/gatekeeper
branch: master # only push dev image tag for master commits
tags: false
- provider: script
script: make docker-login && make docker-push-release IMG=gatekeeper-e2e:latest VERSION=${TRAVIS_TAG}
on:
repo: open-policy-agent/gatekeeper
tags: true # only push release image tag for tags
- name: "helm build, test"
script:
- make e2e-bootstrap
- make e2e-build-load-image IMG=gatekeeper-e2e:latest
- make e2e-helm-deploy HELM_REPO=gatekeeper-e2e HELM_RELEASE=latest
- make test-e2e
- echo -e '\n\n======= manager logs =======\n\n' && kubectl logs -n gatekeeper-system -l control-plane=controller-manager
- stage: "verify release"
if: repo = open-policy-agent/gatekeeper AND type != pull_request AND tag IS present
script:
- make e2e-bootstrap
- export KUBECONFIG="$(kind get kubeconfig-path --name="kind")"
deploy:
- provider: script
script: make e2e-verify-release IMG=quay.io/open-policy-agent/gatekeeper:${TRAVIS_TAG} USE_LOCAL_IMG=false
on:
repo: open-policy-agent/gatekeeper
tags: true # only run verify e2e on the released image tag for tags