@@ -397,3 +397,77 @@ promoteToPublic:
397
397
cat << EOF | buildkite-agent annotate --style info
398
398
Promoted release is **publicly available** through a git tag at [\`{{version}}\`](https://github.com/sourcegraph/deploy-sourcegraph/tree/{{version}}).
399
399
EOF
400
+
401
+ - name : " update main with latest version"
402
+ cmd : |
403
+ set -eu
404
+ branch="promote/release-{{version}}-update-main"
405
+ echo "Checking out origin/main"
406
+ git fetch origin "${branch}"
407
+ git switch main
408
+ echo "Creating branch origin/${branch}"
409
+ git switch -c "${branch}"
410
+
411
+ - name : " sg ops (base)"
412
+ cmd : |
413
+ sg ops update-images \
414
+ --kind k8s \
415
+ --registry index.docker.io/sourcegraph \
416
+ --docker-username=$DOCKER_USERNAME \
417
+ --docker-password=$DOCKER_PASSWORD \
418
+ --pin-tag {{inputs.server.tag}} \
419
+ base/
420
+
421
+ - name : " sg ops (overlays)"
422
+ cmd : |
423
+ folders=$(find overlays -maxdepth 1 -type d \! -name "low-resource")
424
+
425
+ for path in $folders; do
426
+ echo "updating ${path}"
427
+ sg ops update-images \
428
+ --kind k8s \
429
+ --registry index.docker.io/sourcegraph \
430
+ --docker-username=$DOCKER_USERNAME \
431
+ --docker-password=$DOCKER_PASSWORD \
432
+ --pin-tag {{inputs.server.tag}} \
433
+ ${path}/
434
+ done
435
+
436
+ - name : " sg ops (configure)"
437
+ cmd : |
438
+ folders=$(find configure -maxdepth 1 -type d )
439
+
440
+ for path in $folders; do
441
+ echo "updating ${path}"
442
+ sg ops update-images \
443
+ --kind k8s \
444
+ --registry index.docker.io/sourcegraph \
445
+ --docker-username=$DOCKER_USERNAME \
446
+ --docker-password=$DOCKER_PASSWORD \
447
+ --pin-tag {{inputs.server.tag}} \
448
+ ${path}/
449
+ done
450
+ - name : " git:commit"
451
+ cmd : |
452
+ set -eu
453
+ branch="promote/release-{{version}}-update-main"
454
+ find . -name "*.yaml" | xargs git add
455
+ find . -name "*.yml" | xargs git add
456
+
457
+ # Careful with the quoting for the config, using double quotes will lead
458
+ # to the shell dropping out all quotes from the json, leading to failed
459
+ # parsing.
460
+ git commit -am 'prep update main: {{version}}' -m 'update main with latest release'
461
+ git push origin "${branch}"
462
+
463
+ - name : " github:pr"
464
+ cmd : |
465
+ set -eu
466
+ internal_branch="promote/release-{{version}}-update-main"
467
+ gh pr create \
468
+ --fill \
469
+ --draft \
470
+ --base "$internal_branch" \
471
+ --title "Update main: build {{version}}" \
472
+ --body "Test plan: automated release PR, CI will perform additional checks"
473
+ echo "🚢 Please check the associated CI build to ensure the process completed".
0 commit comments