Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Commit b5d7a4f

Browse files
authored
fix(release): add minor step to internal release create command (#64377)
<!-- PR description tips: https://www.notion.so/sourcegraph/Write-a-good-pull-request-description-610a7fd3e613496eb76f450db5a49b6e --> This PR adds the ability to use `--type minor` when running `sg release create` during the release process. For the time being this step is the _same_ as `--type patch` which is the default, however this allows us to differentiate the two types now and prepares for when/if the two types diverge. This also clears up the some confusion as the `sg release` command _can_ accept `--type minor` already and one would expect that to be the choice when you are in fact cutting a minor type. Closes: https://linear.app/sourcegraph/issue/REL-351/sourcegraphsourcegraph64377-fixrelease-add-minor-step-to-internal ## Test plan Tested locally with `--type minor` tag. ```shell ➜ sourcegraph git:(08-08-jdp_release_minor-flag-addition) sg release create --version 5.6.877 --type minor 👉 [ setup] Finding release manifest in "." [ setup] No explicit branch name was provided, assuming current branch is the target: 08-08-jdp_release_minor-flag-addition [ setup] Found manifest for "sourcegraph" (github.com/sourcegraph/sourcegraph) [ meta] Owners: @sourcegraph/release [ meta] Repository: github.com/sourcegraph/sourcegraph 👉 [ vars] Variables [ vars] version="v5.6.877" [ vars] tag="5.6.877" [ vars] config="{\"version\":\"v5.6.877\",\"inputs\":\"\",\"type\":\"minor\"}" [ vars] git.branch="08-08-jdp_release_minor-flag-addition" [ vars] is_development="false" .... Stuff here [ buildkite] Build created, see: [ buildkite] "https://buildkite.com/sourcegraph/sourcegraph/builds/287192" [ step] Step "buildkite" succeeded ``` <!-- REQUIRED; info at https://docs-legacy.sourcegraph.com/dev/background-information/testing_principles --> ## Changelog Internal change, N/A <!-- OPTIONAL; info at https://www.notion.so/sourcegraph/Writing-a-changelog-entry-dd997f411d524caabf0d8d38a24a878c -->
1 parent a9b536c commit b5d7a4f

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

release.yaml

+26
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,32 @@ internal:
5151
echo "Build created, see:"
5252
echo $body | jq .web_url
5353
fi
54+
minor:
55+
- name: 'buildkite'
56+
cmd: |
57+
echo "Triggering build on sourcegraph/sourcegraph with VERSION={{version}} on branch {{git.branch}}"
58+
body=$(wget --content-on-error -O- --header="Content-Type: application/json" --header="Authorization: Bearer $BUILDKITE_ACCESS_TOKEN" --post-data '{
59+
"commit": "HEAD",
60+
"branch": "{{git.branch}}",
61+
"message": "Internal release build for {{version}}",
62+
"env": {
63+
"RELEASE_INTERNAL": "true",
64+
"VERSION": "{{tag}}",
65+
"IS_DEVELOPMENT_RELEASE": "{{is_development}}"
66+
}
67+
}' https://api.buildkite.com/v2/organizations/sourcegraph/pipelines/sourcegraph/builds)
68+
exit_code=$?
69+
70+
if [ $exit_code != 0 ]; then
71+
echo "❌ Failed to create build on Buildkite, got:"
72+
echo "--- raw body ---"
73+
echo $body
74+
echo "--- raw body ---"
75+
exit $exit_code
76+
else
77+
echo "Build created, see:"
78+
echo $body | jq .web_url
79+
fi
5480
finalize:
5581
steps:
5682
- name: 'Register on release registry'

0 commit comments

Comments
 (0)