-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy path.travis.yml
153 lines (134 loc) · 6.19 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
os: linux
dist: xenial
language: go
go:
- "1.13"
env:
global:
- VERBOSE=1
- CI=travis
- IS_CI=true
- E2E_CLEANUP=true
- GO111MODULE=on
- GO15VENDOREXPERIMENT=1
- PUSH_CHART="true"
- CHANGE_MINIKUBE_NONE_USER=true
cache:
directories:
- $HOME/.cache/go-build
- $HOME/gopath/pkg/mod
##################################################################################################
# build/lints/tests
##################################################################################################
install:
- export PATH=~/bin:$PATH
- make ci/setup
jobs:
include:
#####################################################
# stage 1: lint, build and unit-tests
#####################################################
- stage: Build, lint and unit tests
name: "Build, lint and unit tests"
script: make ci/check-format-gen ci/lint ci/build ci/test
#####################################################
# stage 2: end-to-end tests in multiple clouds
#####################################################
# see the ci/infra/providers/CREDENTIALS.md for details on the credentials
- stage: End-to-end tests
name: "e2e tests in Google Cloud (GKE)"
# Run on cron jobs, tagged releases or any builds where commit message contains "test-gke"
if: (type IN (cron, api) OR (tag =~ ^v) OR (commit_message =~ test-gke) OR (commit_message =~ test-cloud)) AND NOT (commit_message =~ skip-test OR commit_message =~ skip-gke OR commit_message =~ skip-cloud)
env:
- CLUSTER_PROVIDER="gke"
- CLUSTER_MACHINE="e2-standard-8"
- CLUSTER_REUSE=1
script: make ci/cluster-setup ci/e2e
- name: "e2e tests in Azure (AKS)"
# Run on cron jobs, tagged releases or any builds where commit message contains "test-azure"
if: (type IN (cron, api) OR (tag =~ ^v) OR (commit_message =~ test-azure) OR (commit_message =~ test-cloud)) AND NOT (commit_message =~ skip-test OR commit_message =~ skip-azure OR commit_message =~ skip-cloud)
env:
- CLUSTER_PROVIDER="azure"
- CLUSTER_REUSE=1
script: make ci/cluster-setup ci/e2e
- name: "e2e tests in a local (1 node) Kubernetes cluster (k3d)"
if: NOT (commit_message =~ skip-test)
env: CLUSTER_PROVIDER="k3d"
script: make ci/cluster-setup ci/e2e
#####################################################
# stage 3: push images
#####################################################
- stage: Push images to repositories
name: "Push images to repositories"
if: (branch =~ ^v) AND (tag =~ ^v) AND (type != pull_request) AND NOT (commit_message =~ skip-push)
env:
- AMB_OPER_IMAGE_TAG="$TRAVIS_TAG"
deploy:
# publish images to Docker.io
# NOTE: make sure DOCKER_USERNAME/DOCKER_PASSWORD have values for a bot
- provider: script
on:
all_branches: true
script: REL_REGISTRY="docker.io/datawire" make ci/publish-image
# publish images to Quay.io
# NOTE: make sure DOCKER_USERNAME/DOCKER_PASSWORD have values for a bot
# (from https://quay.io/repository/datawire/ambassador-operator?tab=settings)
- provider: script
on:
all_branches: true
script: DOCKER_USERNAME="$QUAY_USERNAME" DOCKER_PASSWORD="$QUAY_PASSWORD" REL_REGISTRY="quay.io/datawire" make ci/publish-image
- provider: script
on:
all_branches: true
script: GKE_AUTH="$GCR_AUTH" CLUSTER_PROVIDER="gke" CLUSTER_REGISTRY="datawire" make ci/cluster-setup ci/publish-image-cloud/gcr
- provider: script
on:
all_branches: true
script: CLUSTER_PROVIDER="azure" CLUSTER_REGISTRY="datawire" AZ_RES_GRP="DefaultResourceGroup-EUS" make ci/cluster-setup ci/publish-image-cloud/azure
#####################################################
# stage 4: publish artifacts
#####################################################
- stage: Publish artifacts
name: "Publish artifacts"
if: (branch =~ ^v) AND (tag =~ ^v) AND (type != pull_request) AND NOT (commit_message =~ skip-publish)
env:
- AMB_OPER_IMAGE_TAG="$TRAVIS_TAG"
- REL_REGISTRY="docker.io/datawire"
deploy:
- provider: script
on:
all_branches: true
script: make ci/release
# publish YAMLs to GitHub releases
# `make ci/release` should have left everything in build/artifacts/*
- provider: releases
on:
all_branches: true
api_key:
secure: XFAZ+q3B7TL7ae0lK6Nl4RCkYxknZ0gZ44g/aR5zOcTkAuJ9049vOUol7UQT9ZyRMMOigfma5IQRFqcQlHBPnBRGkuHFGqxx48Kw1pvLRR3BhIYG0aSyDR3ZnI0eEkaKzui1zKBC5R03DK1NpVl+muomNDWgsEb9M9qn7onYQPMfCi4ZZ8x/ev5GtXlHPrCh4O/m51X0nLoVMsvFaogNiiwKtS/sWlLTiY9DWwACF5yY58Q65l3GNiLaIQCIvdU3losq08KJViIE8qBNojCRr+zLXluOlpgVb7ozZ3vWNephuHZoRIvW8hH8MTgaiuDh+XGlbTNlLBrJAF43CPZLQdzZdLMp74XRx90OkXHA8p6crBoQRa5Q7/MhV0pswdMcSKnHIe9dRkkPiGmDGXFg5WAchI6egGskAD4SAZMmiXBoj8TcjtyDa4NExakebrrU/XzvU951teAk2czNs1yoXTDfrpgDiIfI7PaIXgUGJi8VjkuwgSZ8uU1EQNwrvhikngbtFKnzM7I2KGr3nIE9cTxxo81PWoElrGAarArQZjARJp1z2myTqPiUi3FcvFOmaeOZbTvHc2kt2Z5iZCJ4Np/YwmXL7pCjijxbb8MB6MrQLv96woX0do/lDDsq8tXrRRoxGqpRzvBtLWHVMw55aKrbnvfnic1HGwyMZnFex+E=
file_glob: true
file: build/artifacts/*
skip_cleanup: true
# publish helm chart
# NOTE: needs AWS_ACCESS_KEY_ID, AWS_BUCKET and AWS_SECRET_ACCESS_KEY (from keybase)
- provider: script
on:
all_branches: true
script: make ci/cluster-setup ci/publish-chart
#####################################################
# stage 5: smoke tests
#####################################################
- stage: Smoke tests
name: "Smoke tests"
if: (commit_message =~ test-smoke) OR ((branch =~ ^v) AND (tag =~ ^v) AND NOT (commit_message =~ skip-smoke))
on:
all_branches: true
env:
- AMB_OPER_IMAGE_TAG="$TRAVIS_TAG"
script:
- CLUSTER_PROVIDER="" make ci/smoke-tests/minikube
- CLUSTER_PROVIDER="kind" make ci/cluster-setup ci/smoke-tests/kind
after_success:
- make ci/after-success
after_script:
- make ci/cleanup