@@ -31,7 +31,7 @@ internal:
31
31
base/
32
32
- name : " sg ops (overlays)"
33
33
cmd : |
34
- folders=$(find overlays -type d -d 1 \! -name "low-resource")
34
+ folders=$(find overlays -maxdepth 1 overlays -type d \! -name "low-resource")
35
35
36
36
for path in $folders; do
37
37
echo "updating ${path}"
@@ -45,7 +45,7 @@ internal:
45
45
done
46
46
- name : " sg ops (configure)"
47
47
cmd : |
48
- folders=$(find configure -type d -d 1 )
48
+ folders=$(find configure -maxdepth 1 -type d )
49
49
50
50
for path in $folders; do
51
51
echo "updating ${path}"
@@ -59,23 +59,32 @@ internal:
59
59
done
60
60
- name : " git:branch"
61
61
cmd : |
62
- echo "Creating branch wip_{{version}}"
63
- release_branch="wip_{{version}}"
64
- git checkout -b $release_branch
62
+ set -eu
63
+ branch="internal/release-{{version}}"
64
+ echo "Creating branch $branch"
65
+ git checkout -b $branch
65
66
- name : " git:commit"
66
67
cmd : |
67
68
find . -name "*.yaml" | xargs git add
68
69
find . -name "*.yml" | xargs git add
70
+
69
71
# Careful with the quoting for the config, using double quotes will lead
70
72
# to the shell dropping out all quotes from the json, leading to failed
71
73
# parsing.
72
74
git commit -m "release_patch: {{version}}" -m '{{config}}'
73
75
- name : " git:push"
74
76
cmd : |
75
- git push origin wip_{{version}}
76
- - name : " gh cli"
77
+ branch="internal/release-{{version}}"
78
+ git push origin "$branch"
79
+ - name : " github:pr"
77
80
cmd : |
78
- gh pr create -f -t "PRETEND RELEASE WIP: release_patch: build {{version}}" --body "Test plan: automated release PR, CI will perform additional checks" # -l "wip_release"
81
+ set -eu
82
+ gh pr create \
83
+ --fill \
84
+ --draft \
85
+ --title "(internal) release_patch: build {{version}}" \
86
+ --body "Test plan: automated release PR, CI will perform additional checks"
87
+ echo "🚢 Please check the associated CI build to ensure the process completed".
79
88
minor :
80
89
- name : " sg ops (base)"
81
90
cmd : |
@@ -88,7 +97,7 @@ internal:
88
97
base/
89
98
- name : " sg ops (overlays)"
90
99
cmd : |
91
- folders=$(find overlays -type d -d 1 \! -name "low-resource")
100
+ folders=$(find overlays -maxdepth 1 -type d \! -name "low-resource")
92
101
93
102
for path in $folders; do
94
103
echo "updating ${path}"
@@ -102,7 +111,7 @@ internal:
102
111
done
103
112
- name : " sg ops (configure)"
104
113
cmd : |
105
- folders=$(find configure -type d -d 1 )
114
+ folders=$(find configure -maxdepth 1 -type d )
106
115
107
116
for path in $folders; do
108
117
echo "updating ${path}"
@@ -116,23 +125,32 @@ internal:
116
125
done
117
126
- name : " git:branch"
118
127
cmd : |
119
- echo "Creating branch wip_{{version}}"
120
- release_branch="wip_{{version}}"
121
- git checkout -b $release_branch
128
+ set -eu
129
+ branch="internal/release-{{version}}"
130
+ echo "Creating branch $branch"
131
+ git checkout -b $branch
122
132
- name : " git:commit"
123
133
cmd : |
124
134
find . -name "*.yaml" | xargs git add
125
135
find . -name "*.yml" | xargs git add
136
+
126
137
# Careful with the quoting for the config, using double quotes will lead
127
138
# to the shell dropping out all quotes from the json, leading to failed
128
139
# parsing.
129
140
git commit -m "release_minor: {{version}}" -m '{{config}}'
130
141
- name : " git:push"
131
142
cmd : |
132
- git push origin wip_{{version}}
133
- - name : " gh cli"
143
+ branch="internal/release-{{version}}"
144
+ git push origin "$branch"
145
+ - name : " github:pr"
134
146
cmd : |
135
- gh pr create -f -t "PRETEND RELEASE WIP: release_minor: build {{version}}" --body "Test plan: automated release PR, CI will perform additional checks" # -l "wip_release"
147
+ set -eu
148
+ gh pr create \
149
+ --fill \
150
+ --draft \
151
+ --title "(internal) release_patch: build {{version}}" \
152
+ --body "Test plan: automated release PR, CI will perform additional checks"
153
+ echo "🚢 Please check the associated CI build to ensure the process completed".
136
154
major :
137
155
- name : " sg ops (base)"
138
156
cmd : |
@@ -145,7 +163,7 @@ internal:
145
163
base/
146
164
- name : " sg ops (overlays)"
147
165
cmd : |
148
- folders=$(find overlays -type d -d 1 \! -name "low-resource")
166
+ folders=$(find overlays -maxdepth 1 -type d \! -name "low-resource")
149
167
150
168
for path in $folders; do
151
169
echo "updating ${path}"
@@ -159,7 +177,7 @@ internal:
159
177
done
160
178
- name : " sg ops (configure)"
161
179
cmd : |
162
- folders=$(find configure -type d -d 1 )
180
+ folders=$(find configure -maxdepth 1 -type d )
163
181
164
182
for path in $folders; do
165
183
echo "updating ${path}"
@@ -173,31 +191,49 @@ internal:
173
191
done
174
192
- name : " git:branch"
175
193
cmd : |
176
- echo "Creating branch wip_{{version}}"
177
- release_branch="wip_{{version}}"
178
- git checkout -b $release_branch
194
+ set -eu
195
+ branch="internal/release-{{version}}"
196
+ echo "Creating branch $branch"
197
+ git checkout -b $branch
179
198
- name : " git:commit"
180
199
cmd : |
181
200
find . -name "*.yaml" | xargs git add
182
201
find . -name "*.yml" | xargs git add
202
+
183
203
# Careful with the quoting for the config, using double quotes will lead
184
204
# to the shell dropping out all quotes from the json, leading to failed
185
205
# parsing.
186
- git commit -m "release_patch : {{version}}" -m '{{config}}'
206
+ git commit -m "release_major : {{version}}" -m '{{config}}'
187
207
- name : " git:push"
188
208
cmd : |
189
- git push origin wip_{{version}}
190
- - name : " gh cli"
209
+ branch="internal/release-{{version}}"
210
+ git push origin "$branch"
211
+ - name : " github:pr"
191
212
cmd : |
192
- gh pr create -f -t "PRETEND RELEASE WIP: release_major: build {{version}}" --body "Test plan: automated release PR, CI will perform additional checks" # -l "wip_release"
213
+ set -eu
214
+ gh pr create \
215
+ --fill \
216
+ --draft \
217
+ --title "(internal) release_patch: build {{version}}" \
218
+ --body "Test plan: automated release PR, CI will perform additional checks"
219
+ echo "🚢 Please check the associated CI build to ensure the process completed".
193
220
finalize :
194
221
steps :
195
- - name : " git "
222
+ - name : " notifications "
196
223
cmd : |
197
- set -e
198
- git checkout -b wip-release-{{version}}
199
- git push origin wip-release-{{version}}
200
- git checkout -
224
+ set -eu
225
+
226
+ branch="internal/release-{{version}}"
227
+
228
+ # Post a comment on the PR.
229
+ cat << EOF | gh pr comment "$branch" --body-file -
230
+ - :green_circle: Internal release is ready for promotion!
231
+ - :warning: Do not close/merge the pull request or delete the associated branch if you intend to promote it.
232
+ EOF
233
+ # Post an annotation.
234
+ cat << EOF | buildkite-agent annotate --style info
235
+ Internal release is ready for promotion under the branch [\`$branch\`](https://github.com/sourcegraph/deploy-sourcegraph/tree/$branch).
236
+ EOF
201
237
202
238
test :
203
239
steps :
@@ -210,21 +246,23 @@ promoteToPublic:
210
246
steps :
211
247
- name : " git"
212
248
cmd : |
213
- echo "Checking out origin/wip-release-{{version}}"
214
- git fetch origin
215
- git checkout origin/wip-release-{{version}}
249
+ set -eu
250
+ branch="internal/release-{{version}}"
251
+ echo "Checking out origin/${branch}"
252
+ git fetch origin "${branch}"
253
+ git switch "${branch}"
216
254
- name : " sg ops (base)"
217
255
cmd : |
218
256
sg ops update-images \
219
257
--kind k8s \
220
- --registry us-central1-docker.pkg.dev/sourcegraph-ci/rfc795-internal \
258
+ --registry us-central1-docker.pkg.dev/sourcegraph-ci/rfc795-public \
221
259
--docker-username=$DOCKER_USERNAME \
222
260
--docker-password=$DOCKER_PASSWORD \
223
261
--pin-tag {{inputs.server.tag}} \
224
262
base/
225
263
- name : " sg ops (overlays)"
226
264
cmd : |
227
- folders=$(find overlays -type d -d 1 \! -name "low-resource")
265
+ folders=$(find overlays -maxdepth 1 -type d \! -name "low-resource")
228
266
229
267
for path in $folders; do
230
268
echo "updating ${path}"
@@ -238,7 +276,7 @@ promoteToPublic:
238
276
done
239
277
- name : " sg ops (configure)"
240
278
cmd : |
241
- folders=$(find configure -type d -d 1 )
279
+ folders=$(find configure -maxdepth 1 -type d )
242
280
243
281
for path in $folders; do
244
282
echo "updating ${path}"
@@ -252,29 +290,67 @@ promoteToPublic:
252
290
done
253
291
- name : " git:branch"
254
292
cmd : |
255
- echo "Creating branch promote-release_{{version}}"
256
- branch="promote-release_ {{version}}"
257
- git checkout -b $ branch
293
+ set -eu
294
+ branch="promote/release- {{version}}"
295
+ git switch -c "${ branch}"
258
296
- name : " git:commit"
259
297
cmd : |
298
+ set -eu
299
+ branch="promote/release-{{version}}"
260
300
find . -name "*.yaml" | xargs git add
261
301
find . -name "*.yml" | xargs git add
302
+
262
303
# Careful with the quoting for the config, using double quotes will lead
263
304
# to the shell dropping out all quotes from the json, leading to failed
264
305
# parsing.
265
- git commit -m "promote_release: {{version}}" -m '{{config}}'
266
- - name : " github"
306
+ git commit -am 'promote-release: {{version}}' -m '{{config}}'
307
+ git push origin "${branch}"
308
+ - name : " github:pr"
267
309
cmd : |
268
- set -e
269
- git push origin promote-release_{{version}}
270
- gh pr create -f -t "PRETEND PROMOTE RELEASE WIP: promote-release: build {{version}}" --base wip-release-{{version}} --body "Test plan: automated release PR, CI will perform additional checks"
310
+ set -eu
311
+ internal_branch="internal/release-{{version}}"
312
+ gh pr create \
313
+ --fill \
314
+ --draft \
315
+ --base "$internal_branch" \
316
+ --title "(promote) release: build {{version}}" \
317
+ --body "Test plan: automated release PR, CI will perform additional checks"
318
+ echo "🚢 Please check the associated CI build to ensure the process completed".
271
319
finalize :
272
320
# These steps should only really run once the pr created in the create step is merged
273
321
steps :
274
322
- name : git:tag
275
323
cmd : |
276
- set -e
277
- branch="wip-release-{{version}}"
278
- git checkout ${branch}
279
- git tag {{version}}
280
- git push origin ${branch} --tags
324
+ set -eu
325
+
326
+ # Branches
327
+ internal_branch="internal/release-{{version}}"
328
+ promote_branch="promote/release-{{version}}"
329
+ release_branch="qa-release-{{version}}"
330
+
331
+ # Create the final branch holding the tagged commit
332
+ git checkout "${promote_branch}"
333
+ git switch -c "${release_branch}"
334
+ git tag qa-{{version}}
335
+ git push origin ${release_branch} --tags
336
+
337
+ # Web URL to the tag
338
+ tag_url="https://github.com/sourcegraph/deploy-sourcegraph/tree/{{version}}"
339
+
340
+ # Annotate PRs
341
+ cat << EOF | gh pr comment "$internal_branch" --body-file -
342
+ - :green_circle: Release has been promoted, see tag: $tag_url.
343
+ - :no_entry: Do not under any circumstance delete the branch holding the tagged commit (i.e. \`$release_branch\`).
344
+ - :arrow_right: You can safely close the PR and delete its a associated branch.
345
+ EOF
346
+
347
+ cat << EOF | gh pr comment "$promote_branch" --body-file -
348
+ - :green_circle: Release has been promoted, see tag: $tag_url.
349
+ - :no_entry: Do not under any circumstance delete the branch holding the tagged commit (i.e. \`$release_branch\`).
350
+ - :arrow_right: You can safely close that PR and delete its a associated branch.
351
+ EOF
352
+
353
+ # Annotate build
354
+ cat << EOF | buildkite-agent annotate --style info
355
+ Promoted release is **publicly available** through a git tag at [\`{{version}}\`](https://github.com/sourcegraph/deploy-sourcegraph/tree/{{version}}).
356
+ EOF
0 commit comments