diff --git a/release.yaml b/release.yaml index 72e4f5260b3c..4d2fb7100c0d 100644 --- a/release.yaml +++ b/release.yaml @@ -397,3 +397,77 @@ promoteToPublic: cat << EOF | buildkite-agent annotate --style info Promoted release is **publicly available** through a git tag at [\`{{version}}\`](https://github.com/sourcegraph/deploy-sourcegraph/tree/{{version}}). EOF + + - name: "update main with latest version" + cmd: | + set -eu + branch="promote/release-{{version}}-update-main" + echo "Checking out origin/main" + git fetch origin "${branch}" + git switch main + echo "Creating branch origin/${branch}" + git switch -c "${branch}" + + - name: "sg ops (base)" + cmd: | + sg ops update-images \ + --kind k8s \ + --registry index.docker.io/sourcegraph \ + --docker-username=$DOCKER_USERNAME \ + --docker-password=$DOCKER_PASSWORD \ + --pin-tag {{inputs.server.tag}} \ + base/ + + - name: "sg ops (overlays)" + cmd: | + folders=$(find overlays -maxdepth 1 -type d \! -name "low-resource") + + for path in $folders; do + echo "updating ${path}" + sg ops update-images \ + --kind k8s \ + --registry index.docker.io/sourcegraph \ + --docker-username=$DOCKER_USERNAME \ + --docker-password=$DOCKER_PASSWORD \ + --pin-tag {{inputs.server.tag}} \ + ${path}/ + done + + - name: "sg ops (configure)" + cmd: | + folders=$(find configure -maxdepth 1 -type d ) + + for path in $folders; do + echo "updating ${path}" + sg ops update-images \ + --kind k8s \ + --registry index.docker.io/sourcegraph \ + --docker-username=$DOCKER_USERNAME \ + --docker-password=$DOCKER_PASSWORD \ + --pin-tag {{inputs.server.tag}} \ + ${path}/ + done + - name: "git:commit" + cmd: | + set -eu + branch="promote/release-{{version}}-update-main" + find . -name "*.yaml" | xargs git add + find . -name "*.yml" | xargs git add + + # Careful with the quoting for the config, using double quotes will lead + # to the shell dropping out all quotes from the json, leading to failed + # parsing. + git commit -am 'prep update main: {{version}}' -m 'update main with latest release' + git push origin "${branch}" + + - name: "github:pr" + cmd: | + set -eu + internal_branch="promote/release-{{version}}-update-main" + gh pr create \ + --fill \ + --draft \ + --base "$internal_branch" \ + --title "Update main: build {{version}}" \ + --body "Test plan: automated release PR, CI will perform additional checks" + echo "🚢 Please check the associated CI build to ensure the process completed".