Skip to content

Commit 5d694b3

Browse files
authored
feat(rel): add step to release to update main with latest version (#212)
## Description Add step to build process that creates a PR to update `main` with the latest release version. --- ## Checklist <!-- Kubernetes, both Kustomize and Helm, and Docker Compose MUST be kept in sync. You should not merge a change here without a corresponding change in the other repositories, unless it is specific to this deployment type. If uneeded, add link or explanation of why it is not needed here. --> - [NA] Update [CHANGELOG.md](https://github.com/sourcegraph/deploy-sourcegraph-k8s/blob/main/CHANGELOG.md) - [NA] Update [K8s Upgrade notes](https://github.com/sourcegraph/sourcegraph/blob/main/doc/admin/updates/kubernetes.md) - [NA] Kustomiz-specific changes - [NA] Update sister repository: [deploy-sourcegraph-helm](https://github.com/sourcegraph/deploy-sourcegraph-helm) - [NA] Update sister repository: [deploy-sourcegraph-docker](https://github.com/sourcegraph/deploy-sourcegraph-docker) - [NA] Verify all images have a valid tag and SHA256 sum ## Test plan CI during release cycle. <!-- As part of SOC2/GN-104 and SOC2/GN-105 requirements, all pull requests are REQUIRED to provide a "test plan". A test plan is a loose explanation of what you have done or implemented to test this, as outlined in our Testing principles and guidelines: https://docs.sourcegraph.com/dev/background-information/testing_principles Write your test plan here after the "Test plan" header. -->
1 parent 7e2dc72 commit 5d694b3

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

release.yaml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,7 @@ 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+
335336
- name: 'Promote on release registry'
336337
cmd: |
337338
echo "Promoting deploy-sourcegraph-k8s {{version}} release on release registry"
@@ -348,3 +349,61 @@ promoteToPublic:
348349
echo "Build created, see:"
349350
echo $body | jq .web_url
350351
fi
352+
353+
- name: "update main with latest version"
354+
cmd: |
355+
set -eu
356+
branch="promote/release-{{version}}-update-main"
357+
echo "Checking out origin/main"
358+
git fetch origin main
359+
git switch main
360+
echo "Creating branch origin/${branch}"
361+
git switch -c "${branch}"
362+
363+
- name: "sg ops"
364+
cmd: |
365+
set -eu
366+
sg ops update-images \
367+
--kind k8s \
368+
--registry index.docker.io/sourcegraph \
369+
--docker-username=$DOCKER_USERNAME \
370+
--docker-password=$DOCKER_PASSWORD \
371+
--pin-tag {{inputs.server.tag}} \
372+
base/
373+
374+
- name: "sg ops (executors)"
375+
cmd: |
376+
set -eu
377+
sg ops update-images \
378+
--kind k8s \
379+
--registry index.docker.io/sourcegraph \
380+
--docker-username=$DOCKER_USERNAME \
381+
--docker-password=$DOCKER_PASSWORD \
382+
--pin-tag {{inputs.server.tag}} \
383+
components/executors/
384+
385+
- name: "git:commit"
386+
cmd: |
387+
set -eu
388+
branch="promote/release-{{version}}-update-main"
389+
find . -name "*.yaml" | xargs git add
390+
find . -name "*.yml" | xargs git add
391+
392+
# Careful with the quoting for the config, using double quotes will lead
393+
# to the shell dropping out all quotes from the json, leading to failed
394+
# parsing.
395+
git commit -am 'update-main: {{version}}' -m 'update main with latest release'
396+
git push origin "${branch}"
397+
398+
- name: "github:pr"
399+
cmd: |
400+
set -eu
401+
internal_branch="promote/release-{{version}}-update-main"
402+
gh pr create \
403+
--fill \
404+
--draft \
405+
--base "$internal_branch" \
406+
--title "Update main: build {{version}}" \
407+
--body "Test plan: automated release PR, CI will perform additional checks"
408+
echo "🚢 Please check the associated CI build to ensure the process completed".
409+

0 commit comments

Comments
 (0)