Skip to content

Commit f4bc8e0

Browse files
committed
add step to release to update main with latest version
1 parent 7e2dc72 commit f4bc8e0

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

release.yaml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,64 @@ promoteToPublic:
332332
cat << EOF | buildkite-agent annotate --style info
333333
Promoted release is **publicly available** through a git tag at [\`{{version}}\`](https://github.com/sourcegraph/deploy-sourcegraph-k8s/tree/{{version}}).
334334
EOF
335+
336+
- name: "update main with latest version"
337+
cmd: |
338+
set -eu
339+
branch="promote/release-{{version}}-update-main"
340+
echo "Checking out origin/main"
341+
git fetch origin main
342+
git switch main
343+
echo "Creating branch origin/${branch}"
344+
git switch -c "${branch}"
345+
346+
- name: "sg ops"
347+
cmd: |
348+
set -eu
349+
sg ops update-images \
350+
--kind k8s \
351+
--registry index.docker.io/sourcegraph \
352+
--docker-username=$DOCKER_USERNAME \
353+
--docker-password=$DOCKER_PASSWORD \
354+
--pin-tag {{inputs.server.tag}} \
355+
base/
356+
357+
- name: "sg ops (executors)"
358+
cmd: |
359+
set -eu
360+
sg ops update-images \
361+
--kind k8s \
362+
--registry index.docker.io/sourcegraph \
363+
--docker-username=$DOCKER_USERNAME \
364+
--docker-password=$DOCKER_PASSWORD \
365+
--pin-tag {{inputs.server.tag}} \
366+
components/executors/
367+
368+
- name: "git:commit"
369+
cmd: |
370+
set -eu
371+
branch="promote/release-{{version}}-update-main"
372+
find . -name "*.yaml" | xargs git add
373+
find . -name "*.yml" | xargs git add
374+
375+
# Careful with the quoting for the config, using double quotes will lead
376+
# to the shell dropping out all quotes from the json, leading to failed
377+
# parsing.
378+
git commit -am 'update-main: {{version}}' -m 'update main with latest release'
379+
git push origin "${branch}"
380+
381+
- name: "github:pr"
382+
cmd: |
383+
set -eu
384+
internal_branch="promote/release-{{version}}-update-main"
385+
gh pr create \
386+
--fill \
387+
--draft \
388+
--base "$internal_branch" \
389+
--title "Update main: build {{version}}" \
390+
--body "Test plan: automated release PR, CI will perform additional checks"
391+
echo "🚢 Please check the associated CI build to ensure the process completed".
392+
335393
- name: 'Promote on release registry'
336394
cmd: |
337395
echo "Promoting deploy-sourcegraph-k8s {{version}} release on release registry"

0 commit comments

Comments
 (0)