-
Notifications
You must be signed in to change notification settings - Fork 103
/
cloudbuild.yaml
117 lines (104 loc) · 4.25 KB
/
cloudbuild.yaml
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
steps:
# Can create a dep cache by running 'gcloud builds submit . --config=cloudbuild-cache.yaml'
# These two steps should populate the cache
- name: gcr.io/cloud-builders/gsutil
entrypoint: 'bash'
args: ['-c', 'mkdir -p ./gopath/pkg/dep && gsutil cat gs://solo-public-cache/squash/squash-dep.tar.gz | tar -xzf -']
id: 'download-untar-dep-cache'
waitFor: ['-']
# Run dep to set up the project so it can be built and tested
# Dep modifies workspace so that the code is moved into the PROJECT_ROOT
# All steps after this must set GOPATH
- name: 'gcr.io/$PROJECT_ID/dep'
args: ['ensure']
env:
- 'PROJECT_ROOT=github.com/solo-io/squash'
- 'GIT_SSH_CONFIG=FALSE'
id: 'dep'
waitFor: ['download-untar-dep-cache']
# Run some basic checks on the repo
# 1) check formatting of go files
# 2) ensure that make generated-code produces a clean diff
# 3) ensure that the site is generated with no warnings (strict = true in mkdocs)
# e2e-ginkgo is produced from https://github.com/solo-io/cloud-builders/e2e-ginkgo
# Must set the GOPATH to tell the container the workspace has already been set up (by the dep step above)
- name: 'gcr.io/$PROJECT_ID/e2e-ginkgo'
env:
- 'PROJECT_ROOT=github.com/solo-io/squash'
- 'GOPATH=/workspace/gopath'
- 'BUILD_ID=$BUILD_ID'
dir: './gopath/src/github.com/solo-io/squash'
entrypoint: 'make'
args: ['check-format']
waitFor: ['dep']
id: 'check-format'
- name: gcr.io/cloud-builders/gcloud
args: ['config', 'set', 'compute/zone', 'us-central1-a']
id: 'set-zone'
waitFor: ['dep']
- name: gcr.io/cloud-builders/gcloud
args: ['container', 'clusters', 'get-credentials', 'squash-test']
id: 'get-creds'
waitFor: ['set-zone']
- name: 'gcr.io/$PROJECT_ID/go-make'
entrypoint: 'bash'
args: ['ci/check-code-and-docs-gen.sh']
env:
- 'PROJECT_ROOT=github.com/solo-io/squash'
- 'GOPATH=/workspace/gopath'
- 'TAGGED_VERSION=$TAG_NAME'
- 'BUILD_ID=$BUILD_ID'
dir: './gopath/src/github.com/solo-io/squash'
waitFor: ['get-creds']
id: 'check-code-and-docs-gen'
- name: 'gcr.io/cloud-builders/docker'
entrypoint: 'bash'
args: ['-c', 'docker login quay.io --username "solo-io+solobot" --password $$QUAY_IO_PASSWORD']
secretEnv: ['QUAY_IO_PASSWORD']
waitFor: ['-']
id: 'docker-login'
- name: 'gcr.io/$PROJECT_ID/go-make'
args: ['docker-push', 'upload-github-release-assets', 'push-docs']
env:
- 'PROJECT_ROOT=github.com/solo-io/squash'
- 'GOPATH=/workspace/gopath'
- 'TAGGED_VERSION=$TAG_NAME'
- 'BUILD_ID=$BUILD_ID'
- 'GCLOUD_PROJECT_ID=$PROJECT_ID'
dir: './gopath/src/github.com/solo-io/squash'
secretEnv: ['GITHUB_TOKEN']
waitFor: ['docker-login', 'dep', 'check-code-and-docs-gen']
id: 'push-github-resources'
- name: 'gcr.io/$PROJECT_ID/e2e-ginkgo'
env:
- 'PROJECT_ROOT=github.com/solo-io/squash'
- 'GOPATH=/workspace/gopath'
- 'CLOUDSDK_COMPUTE_ZONE=us-central1-a'
- 'CLOUDSDK_CONTAINER_CLUSTER=squash-test'
- 'RUN_KUBE_TESTS=1'
- 'TAGGED_VERSION=$TAG_NAME'
- 'BUILD_ID=$BUILD_ID'
- 'DOCKER_CONFIG=/workspace/.docker/'
dir: './gopath/src/github.com/solo-io/squash'
args: ['-r', '-failFast', '-p']
waitFor: ['get-creds', 'check-code-and-docs-gen', 'push-github-resources']
id: 'e2e-test'
- name: 'gcr.io/$PROJECT_ID/go-vsce:0.1.4'
entrypoint: make
args: ['publish-extension']
env:
- 'TAGGED_VERSION=$TAG_NAME'
- 'BUILD_ID=$BUILD_ID'
- 'PROJECT_ROOT=github.com/solo-io/squash'
- 'GOPATH=/workspace/gopath'
dir: './gopath/src/github.com/solo-io/squash'
secretEnv: ['VSCODE_TOKEN']
waitFor: ['e2e-test','push-github-resources']
id: 'extension'
secrets:
- kmsKeyName: projects/solo-public/locations/global/keyRings/build/cryptoKeys/build-key
secretEnv:
GITHUB_TOKEN: CiQABlzmSYYiveU0gTxGH2139eaBUedjV3vNCxQmJU+nRPlfQ/YSUQCCPGSGzbGp49fwDYuefAx9V94b8mivdp9AqB7zQAa07VtGJmrGdg9ZuhKGFrrgqxwABE0LLVNHyngCSHYSYMH8Vn/mRtT7wQuEHBlKVGtqPw==
QUAY_IO_PASSWORD: CiQABlzmSRx5TcOqbldXa/d/+bkmAfpNAWa3PTS06WvuloZL+vASaQCCPGSGCogonVZVEUNx4G3YJtWi18gSuNx4PvLe08q8xAflTMFkjsyQirAOK3Y2oCvgYwiw/ITcuydjkpMjxDygFyENXS9FKFJoAXHlPQE5qidKr8xxmxF5ezhmjGB0gjyjXIIkbSEnBg==
VSCODE_TOKEN: CiQABlzmSbqH3PONM3aPwC5QSEAbMGCcBNzY727oaSJKlh6Q/TESXgCCPGSG56yrJU+3Wu0c07bsg8gIVDQiQu+TLNG/SRpPZzvWkQiTakxfTG8vRu0YyHea6IyTcyIM0SYmryxfpVPNfqxZqJ16Zm5QgHoQexQuE5RtchLiMh2QdKc+k6A=
timeout: 3000s