Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(rel): add step to release to update main with latest version #4399

Merged
merged 1 commit into from
Dec 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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".
Loading