-
Notifications
You must be signed in to change notification settings - Fork 42
/
cloudbuild.yaml
111 lines (102 loc) · 3.73 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
steps:
- name: 'gcr.io/cloud-builders/wget'
entrypoint: ./ci/spell.sh
args: ['check']
waitFor: ['-']
env:
- 'LSCOMMAND=find * -path gopath -prune -o -print'
id: 'check-spelling'
# 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/sqoop/sqoop-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/sqoop'
- 'GIT_SSH_CONFIG=FALSE'
id: 'dep'
waitFor: ['download-untar-dep-cache']
# Helm setup
# 1) Create directory to sync helm data
- name: gcr.io/cloud-builders/gsutil
entrypoint: mkdir
args: ['-p', './_output/helm']
dir: './gopath/src/github.com/solo-io/sqoop'
waitFor: ['dep']
id: 'make-helm-dir'
- name: gcr.io/cloud-builders/gsutil
args:
- rsync
- -r
- gs://sqoop-helm/
- './_output/helm'
dir: './gopath/src/github.com/solo-io/sqoop'
waitFor: ['make-helm-dir']
id: 'setup-helm'
# run all of the tests
- name: 'gcr.io/$PROJECT_ID/e2e-ginkgo'
env:
- 'PROJECT_ROOT=github.com/solo-io/sqoop'
- 'GOPATH=/workspace/gopath'
- 'CLOUDSDK_COMPUTE_ZONE=us-central1-a'
- 'CLOUDSDK_CONTAINER_CLUSTER=test-cluster'
dir: './gopath/src/github.com/solo-io/sqoop'
args: ['-r', '-failFast', '-p']
waitFor: ['setup-helm']
id: 'test'
# Build everything
# 1) Compile all docker images
# 2) Run make targets to push docker images, compile manifests, produce release artifacts, deploy docs
# 3) Publish helm chart
- name: 'gcr.io/cloud-builders/docker'
entrypoint: 'bash'
args: ['-c', 'docker login --username soloiobot --password $$DOCKER_HUB_PASSWORD']
secretEnv: ['DOCKER_HUB_PASSWORD']
id: 'docker-login'
waitFor: ['test']
- name: 'gcr.io/$PROJECT_ID/go-make'
args: ['docker']
env:
- 'PROJECT_ROOT=github.com/solo-io/sqoop'
- 'GOPATH=/workspace/gopath'
- 'TAGGED_VERSION=$TAG_NAME'
dir: './gopath/src/github.com/solo-io/sqoop'
waitFor: ['docker-login']
id: 'compile'
- name: 'gcr.io/$PROJECT_ID/go-make'
args: ['docker-push', 'manifest', 'build-cli', 'upload-github-release-assets', 'push-docs']
env:
- 'TAGGED_VERSION=$TAG_NAME'
- 'PROJECT_ROOT=github.com/solo-io/sqoop'
- 'GOPATH=/workspace/gopath'
- 'HELM_HOME=/root/.helm' # tell helm where to find data
dir: './gopath/src/github.com/solo-io/sqoop'
secretEnv: ['GITHUB_TOKEN']
id: 'release'
waitFor: ['compile']
# Sync helm chart data back to google storage bucket
- name: gcr.io/cloud-builders/gsutil
args:
- rsync
- -r
- './_output/helm'
- gs://sqoop-helm/
dir: './gopath/src/github.com/solo-io/sqoop'
waitFor: ['release']
id: 'set-helm-chart'
secrets:
- kmsKeyName: projects/solo-public/locations/global/keyRings/build/cryptoKeys/build-key
secretEnv:
GITHUB_TOKEN: CiQABlzmSYYiveU0gTxGH2139eaBUedjV3vNCxQmJU+nRPlfQ/YSUQCCPGSGzbGp49fwDYuefAx9V94b8mivdp9AqB7zQAa07VtGJmrGdg9ZuhKGFrrgqxwABE0LLVNHyngCSHYSYMH8Vn/mRtT7wQuEHBlKVGtqPw==
DOCKER_HUB_PASSWORD: CiQABlzmSW0u+qhXDvTCxLnbi09Zm88eCU0wSdvFn1W+6WOpTgQSTgCCPGSGTAlMndrEkYOynPhDzTXrW1q1eAsQYjKOWOwZKodcQZ2WIzdvpOOjv+WrGTssWWg1uPFV4CnajT7DzeNAb7USkla1epatm6OnuQ==
timeout: 6600s
tags: ['sqoop']
options:
machineType: 'N1_HIGHCPU_32'