forked from GoogleCloudPlatform/magic-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgcb-push-downstream.yml
213 lines (191 loc) · 6.4 KB
/
gcb-push-downstream.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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
---
steps:
# The GCB / GH integration doesn't satisfy our use case perfectly.
# It doesn't check out the repo itself - it only gives us the actual code.
# So we need to handle that access ourselves - which means deleting the code
# and cloning the repo to the present directory. We need to use
# 'sh' to evaluate the '*' arguments, which otherwise would be
# passed literally to 'rm'.
- name: 'alpine'
args:
- sh
- -c
- rm -rf ./* ./.* || true
- name: 'gcr.io/cloud-builders/git'
id: clone
args:
- clone
- https://github.com/GoogleCloudPlatform/magic-modules
- .
- name: 'gcr.io/cloud-builders/git'
id: checkout
args:
- checkout
- $COMMIT_SHA
# TPG
- name: 'gcr.io/graphite-docker-images/downstream-waiter'
id: tpg-sync
secretEnv: ["GITHUB_TOKEN"]
waitFor: ["checkout"]
args:
- 'tpg-sync'
- $BRANCH_NAME
- $COMMIT_SHA
- name: 'gcr.io/graphite-docker-images/downstream-builder'
secretEnv: ["GITHUB_TOKEN"]
id: tpg-push
waitFor: ["tpg-sync"]
args:
- 'downstream'
- 'terraform'
- 'ga'
- $COMMIT_SHA
- name: 'gcr.io/cloud-builders/git'
waitFor: ["tpg-push"]
secretEnv: ["GITHUB_TOKEN"]
entrypoint: 'bash'
args:
- -c
- git push https://modular-magician:[email protected]/GoogleCloudPlatform/magic-modules $COMMIT_SHA:tpg-sync
# TPGB
- name: 'gcr.io/graphite-docker-images/downstream-waiter'
id: tpgb-sync
secretEnv: ["GITHUB_TOKEN"]
waitFor: ["checkout"]
args:
- 'tpgb-sync'
- $BRANCH_NAME
- $COMMIT_SHA
- name: 'gcr.io/graphite-docker-images/downstream-builder'
secretEnv: ["GITHUB_TOKEN"]
id: tpgb-push
waitFor: ["tpgb-sync"]
args:
- 'downstream'
- 'terraform'
- 'beta'
- $COMMIT_SHA
- name: 'gcr.io/cloud-builders/git'
waitFor: ["tpgb-push"]
secretEnv: ["GITHUB_TOKEN"]
entrypoint: 'bash'
args:
- -c
- git push https://modular-magician:[email protected]/GoogleCloudPlatform/magic-modules $COMMIT_SHA:tpgb-sync
# TF-CONV
- name: 'gcr.io/graphite-docker-images/downstream-waiter'
id: tf-conv-sync
secretEnv: ["GITHUB_TOKEN"]
waitFor: ["checkout"]
args:
- 'tf-conv-sync'
- $BRANCH_NAME
- $COMMIT_SHA
- name: 'gcr.io/graphite-docker-images/downstream-builder'
secretEnv: ["GITHUB_TOKEN"]
id: tf-conv-push
waitFor: ["tf-conv-sync"]
args:
- 'downstream'
- 'tf-conversion'
- 'ga'
- $COMMIT_SHA
- name: 'gcr.io/cloud-builders/git'
waitFor: ["tf-conv-push"]
secretEnv: ["GITHUB_TOKEN"]
entrypoint: 'bash'
args:
- -c
- git push https://modular-magician:[email protected]/GoogleCloudPlatform/magic-modules $COMMIT_SHA:tf-conv-sync
# TF-OICS
- name: 'gcr.io/graphite-docker-images/downstream-waiter'
id: tf-oics-sync
secretEnv: ["GITHUB_TOKEN"]
waitFor: ["checkout"]
args:
- 'tf-oics-sync'
- $BRANCH_NAME
- $COMMIT_SHA
- name: 'gcr.io/graphite-docker-images/downstream-builder'
secretEnv: ["GITHUB_TOKEN"]
id: tf-oics-push
waitFor: ["tf-oics-sync"]
args:
- 'downstream'
- 'tf-oics'
- 'ga'
- $COMMIT_SHA
- name: 'gcr.io/cloud-builders/git'
waitFor: ["tf-oics-push"]
secretEnv: ["GITHUB_TOKEN"]
entrypoint: 'bash'
args:
- -c
- git push https://modular-magician:[email protected]/GoogleCloudPlatform/magic-modules $COMMIT_SHA:tf-oics-sync
# Ansible
- name: 'gcr.io/graphite-docker-images/downstream-waiter'
id: ansible-sync
secretEnv: ["GITHUB_TOKEN"]
waitFor: ["checkout"]
args:
- 'ansible-sync'
- $BRANCH_NAME
- $COMMIT_SHA
- name: 'gcr.io/graphite-docker-images/downstream-builder'
secretEnv: ["GITHUB_TOKEN"]
id: ansible-push
waitFor: ["ansible-sync"]
args:
- 'downstream'
- 'ansible'
- 'ga'
- $COMMIT_SHA
- name: 'gcr.io/cloud-builders/git'
waitFor: ["ansible-push"]
secretEnv: ["GITHUB_TOKEN"]
entrypoint: 'bash'
args:
- -c
- git push https://modular-magician:[email protected]/GoogleCloudPlatform/magic-modules $COMMIT_SHA:ansible-sync
# Inspec
- name: 'gcr.io/graphite-docker-images/downstream-waiter'
id: inspec-sync
secretEnv: ["GITHUB_TOKEN"]
waitFor: ["checkout"]
args:
- 'inspec-sync'
- $BRANCH_NAME
- $COMMIT_SHA
- name: 'gcr.io/graphite-docker-images/downstream-builder'
secretEnv: ["GITHUB_TOKEN"]
id: inspec-push
waitFor: ["inspec-sync"]
args:
- 'downstream'
- 'inspec'
- 'beta'
- $COMMIT_SHA
- name: 'gcr.io/cloud-builders/git'
waitFor: ["inspec-push"]
secretEnv: ["GITHUB_TOKEN"]
entrypoint: 'bash'
args:
- -c
- git push https://modular-magician:[email protected]/GoogleCloudPlatform/magic-modules $COMMIT_SHA:inspec-sync
- name: 'gcr.io/graphite-docker-images/vcr-cassette-merger'
secretEnv: ["GITHUB_TOKEN", "GOOGLE_PROJECT"]
waitFor: ["tpg-push"]
args:
- $COMMIT_SHA
# set extremely long 1 day timeout, in order to ensure that any jams / backlogs can be cleared.
timeout: 86400s
options:
machineType: 'N1_HIGHCPU_8'
# This is the ciphertext of the token, encrypted using the above KMS key.
secrets:
- kmsKeyName: projects/graphite-docker-images/locations/global/keyRings/token-keyring/cryptoKeys/github-token
secretEnv:
GITHUB_TOKEN: CiQADkR4Nt6nHLI52Kc1W55OwpLdc4vjBfVR0SGQNzm6VSVj9lUSUQBfF82vVhn43A1jNYOv8ScoWgrZONwNrUabHfGjkvl+IZxcii0JlOVUawbscs4OJga0eitNNlagAOruLs6C926X20ZZPqWtH97ui6CKNvxgkQ==
- kmsKeyName: projects/graphite-docker-images/locations/global/keyRings/environment-keyring/cryptoKeys/ci-project-key
secretEnv:
GOOGLE_PROJECT: CiQAis6xrDDU4Wcxn5s8Y790IMxTUEe2d3SaYEXUGScHfaLjOw8SPwDOc1nLe6Yz0zzA0mcYTsXaeGSFYu7uQ5+QCtTProJWRv2ITrNwCS3AF/kvMCrHvltx7O1CZnJveutlVpZH3w==