forked from open-policy-agent/gatekeeper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
56 lines (53 loc) · 2.11 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
54
55
sudo: required
language: go
go_import_path: github.com/open-policy-agent/gatekeeper
go:
- "1.12.x"
services:
- docker
jobs:
include:
- stage: e2e
before_script:
- KIND_VERSION=0.4.0
- KUSTOMIZE_VERSION=3.0.2
# Download and install kind
- curl -L https://github.com/kubernetes-sigs/kind/releases/download/v${KIND_VERSION}/kind-linux-amd64 --output kind && chmod +x kind && sudo mv kind /usr/local/bin/
# Create kind cluster
- |
if [ $(kind get clusters) ]; then
export KUBECONFIG="$(kind get kubeconfig-path --name="kind")"
else
kind create cluster
fi
# Get kubeconfig
- export KUBECONFIG="$(kind get kubeconfig-path --name="kind")"
# Build image and tag as gatekeeper-e2e:latest
- make docker-build REPOSITORY=gatekeeper-e2e
# Load Gatekeeper image into kind cluster
- kind load docker-image --name kind gatekeeper-e2e:latest
# Download and install kubectl
- curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && chmod +x ./kubectl && sudo mv kubectl /usr/local/bin/
# Download and install kustomize
- curl -L https://github.com/kubernetes-sigs/kustomize/releases/download/v${KUSTOMIZE_VERSION}/kustomize_${KUSTOMIZE_VERSION}_linux_amd64 --output kustomize && chmod +x kustomize && sudo mv kustomize /usr/local/bin/
script:
- make deploy
- make test-e2e
- echo -e '\n\n======= manager logs =======\n\n' && kubectl logs -n gatekeeper-system gatekeeper-controller-manager-0 manager
- stage: "build, test, deploy"
script: make
deploy:
- provider: script
skip_cleanup: true
script: make travis-dev-deploy
on:
repo: open-policy-agent/gatekeeper
branch: master
tags: false
- provider: script
skip_cleanup: true
script: make travis-dev-release
on:
repo: open-policy-agent/gatekeeper
branch: master
tags: true