Skip to content

Commit d5ccc1e

Browse files
authored
feat(rel): update main with latest version during release (#1124)
Add a step to our build process that creates a PR with the latest release version to merge back into `main`. ### Checklist <!-- Kubernetes and Docker Compose MUST be kept in sync. You should not merge a change here without a corresponding change in the other repository, unless it truly is specific to this repository. If uneeded, add link or explanation of why it is not needed here. --> * [NA] Sister [deploy-sourcegraph](https://github.com/sourcegraph/deploy-sourcegraph) change: * [NA] Sister [customer-replica](https://github.com/sourcegraph/deploy-sourcegraph-docker-customer-replica-1) change (if necessary, for any changes affecting pure-docker or configuration): * [NA] All images have a valid tag and SHA256 sum ### Test plan Part of the CI pipeline of a release
1 parent c3e0951 commit d5ccc1e

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

release.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,3 +247,47 @@ promoteToPublic:
247247
cat << EOF | buildkite-agent annotate --style info
248248
Promoted release is **publicly available** through a git tag at [\`{{version}}\`](https://github.com/sourcegraph/deploy-sourcegraph-docker/tree/{{version}}).
249249
EOF
250+
251+
- name: "update main with latest version"
252+
- name: "git"
253+
cmd: |
254+
set -eu
255+
branch="promote/release-{{version}}-update-main"
256+
echo "Checking out origin/main"
257+
git fetch origin main
258+
git switch main
259+
echo "Creating branch origin/${branch}"
260+
git switch -c "${branch}"
261+
262+
- name: docker(compose):tags
263+
cmd: |
264+
set -eu
265+
registry=index.docker.io/sourcegraph
266+
sg ops update-images --registry ${registry} --kind compose --pin-tag {{inputs.server.tag}} --docker-username $DOCKER_USERNAME --docker-password $DOCKER_PASSWORD docker-compose/
267+
268+
- name: docker(shell):tags
269+
cmd: |
270+
set -eu
271+
registry=index.docker.io/sourcegraph
272+
sg ops update-images --registry ${registry} --kind shell --pin-tag {{inputs.server.tag}} --docker-username $DOCKER_USERNAME --docker-password $DOCKER_PASSWORD pure-docker/
273+
274+
- name: "git:branch"
275+
cmd: |
276+
set -eu
277+
branch="promote/release-{{version}}-update-main"
278+
git commit -am 'prep update main: {{version}}' -m 'update main with latest release'
279+
git push origin "${branch}"
280+
281+
- name: "github:pr"
282+
cmd: |
283+
set -eu
284+
internal_branch="promote/release-{{version}}-update-main"
285+
# we need to fetch from origin just in case this branch doesn't exist locally, so that the PR can find the base
286+
git fetch origin "${internal_branch}"
287+
gh pr create \
288+
--fill \
289+
--draft \
290+
--base "$internal_branch" \
291+
--title "Update main: build {{version}}" \
292+
--body "Test plan: automated release PR, CI will perform additional checks"
293+
echo "🚢 Please check the associated CI build to ensure the process completed".

0 commit comments

Comments
 (0)