55 - " @sourcegraph/release"
66 repository : " github.com/sourcegraph/deploy-sourcegraph-docker"
77inputs :
8- releaseId : server
8+ - releaseId : server
99requirements :
1010 - name : " go"
1111 cmd : " which go"
@@ -14,116 +14,187 @@ requirements:
1414 cmd : " which gh"
1515 fixInstructions : " install GitHub cli"
1616internal :
17+ # Please keep in mind that the CI pipeline uses the branch names defined below when creating releases.
18+ # Therefore, if you update them, or if you decide to change how we detect what kind of build we're dealing
19+ # with, please update this file as well.
1720 create :
1821 steps :
1922 patch :
2023 - name : docker(compose):tags
2124 cmd : |
22- set -e
25+ set -eu
2326 registry=us-central1-docker.pkg.dev/sourcegraph-ci/rfc795-internal
2427 sg ops update-images --registry ${registry} --kind compose --pin-tag {{tag}} docker-compose/
2528 - name : docker(shell):tags
2629 cmd : |
27- set -e
30+ set -eu
2831 registry=us-central1-docker.pkg.dev/sourcegraph-ci/rfc795-internal
2932 sg ops update-images --registry ${registry} --kind shell --pin-tag {{tag}} pure-docker/
3033 - name : " git:branch"
3134 cmd : |
32- branch="wip_{{version}}"
35+ set -eu
36+ branch="internal/release-{{version}}"
3337 git switch -c "${branch}"
3438 git commit -am 'release_patch: {{version}}' -m '{{config}}'
3539 git push origin ${branch}
36- - name : " gh "
40+ - name : " github:pr "
3741 cmd : |
38- gh pr create -f -t "PRETEND RELEASE WIP: release_patch: build {{version}}" --body "Test plan: automated release PR, CI will perform additional checks"
42+ gh pr create \
43+ --fill \
44+ --draft \
45+ --title "(internal) release_patch: build {{version}}" \
46+ --body "Test plan: automated release PR, CI will perform additional checks"
47+ echo "🚢 Please check the associated CI build to ensure the process completed".
3948 minor :
4049 - name : docker(compose):tags
4150 cmd : |
42- set -e
51+ set -eu
4352 registry=us-central1-docker.pkg.dev/sourcegraph-ci/rfc795-internal
4453 sg ops update-images --registry ${registry} --kind compose --pin-tag {{tag}} docker-compose/
4554 - name : docker(shell):tags
4655 cmd : |
47- set -e
56+ set -eu
4857 registry=us-central1-docker.pkg.dev/sourcegraph-ci/rfc795-internal
4958 sg ops update-images --registry ${registry} --kind shell --pin-tag {{tag}} pure-docker/
5059 - name : " git:branch"
5160 cmd : |
52- branch="wip_{{version}}"
61+ set -eu
62+ branch="internal/release-{{version}}"
5363 git switch -c "${branch}"
5464 git commit -am 'release_minor: {{version}}' -m '{{config}}'
5565 git push origin ${branch}
56- - name : " gh "
66+ - name : " github:pr "
5767 cmd : |
58- gh pr create -f -t "PRETEND RELEASE WIP: release_minor: build {{version}}" --body "Test plan: automated release PR, CI will perform additional checks"
68+ gh pr create \
69+ --fill \
70+ --draft \
71+ --title "(internal) release_minor: build {{version}}" \
72+ --body "Test plan: automated release PR, CI will perform additional checks"
73+ echo "🚢 Please check the associated CI build to ensure the process completed".
5974 major :
6075 - name : docker(compose):tags
6176 cmd : |
62- set -e
77+ set -eu
6378 registry=us-central1-docker.pkg.dev/sourcegraph-ci/rfc795-internal
6479 sg ops update-images --registry ${registry} --kind compose --pin-tag {{tag}} docker-compose/
6580 - name : docker(shell):tags
6681 cmd : |
67- set -e
82+ set -eu
6883 registry=us-central1-docker.pkg.dev/sourcegraph-ci/rfc795-internal
6984 sg ops update-images --registry ${registry} --kind shell --pin-tag {{tag}} pure-docker/
7085 - name : " git:branch"
7186 cmd : |
72- branch="wip_{{version}}"
87+ set -eu
88+ branch="internal/release-{{version}}"
7389 git switch -c "${branch}"
7490 git commit -am 'release_major: {{version}}' -m '{{config}}'
7591 git push origin ${branch}
76- - name : " gh "
92+ - name : " github:pr "
7793 cmd : |
78- gh pr create -f -t "PRETEND RELEASE WIP: release_major: build {{version}}" --body "Test plan: automated release PR, CI will perform additional checks"
94+ gh pr create \
95+ --fill \
96+ --draft \
97+ --title "(internal) release_major: build {{version}}" \
98+ --body "Test plan: automated release PR, CI will perform additional checks"
99+ echo "🚢 Please check the associated CI build to ensure the process completed".
79100 finalize :
80101 steps :
81102 - name : " git:finalize"
82103 cmd : |
83- set -e
84- branch="wip_release-{{version}}"
85- git switch -c "${branch}"
86- echo "pushing branch ${branch}"
87- git push origin "${branch}"
88- git checkout -
104+ set -eu
105+
106+ branch="internal/release-{{version}}"
107+
108+ # Post a comment on the PR.
109+ cat << EOF | gh pr comment "$branch" --body-file -
110+ - :green_circle: Internal release is ready for promotion!
111+ - :warning: Do not close/merge that pull request or delete the associated branch if you intend to promote it.
112+ EOF
113+
114+ # Post an annotation.
115+ cat << EOF | buildkite-agent annotate --style info
116+ Internal release is ready for promotion under the branch [\`$branch\`](https://github.com/sourcegraph/deploy-sourcegraph-docker/tree/$branch).
117+ EOF
89118test :
90119 steps :
91- - name : " foo "
120+ - name : " Placeholder "
92121 cmd : |
93122 echo "Test"
94123
95124promoteToPublic :
96125 create :
97126 steps :
127+ - name : " git"
128+ cmd : |
129+ set -eu
130+ branch="internal/release-{{version}}"
131+ git fetch origin "${branch}"
132+ git switch "${branch}"
98133 - name : docker(compose):tags
99134 cmd : |
100- set -e
135+ set -eu
101136 registry=us-central1-docker.pkg.dev/sourcegraph-ci/rfc795-public
102137 sg ops update-images --registry ${registry} --kind compose --pin-tag {{tag}} docker-compose/
103138 - name : docker(shell):tags
104139 cmd : |
105- set -e
140+ set -eu
106141 registry=us-central1-docker.pkg.dev/sourcegraph-ci/rfc795-public
107142 sg ops update-images --registry ${registry} --kind shell --pin-tag {{tag}} pure-docker/
108143 - name : " git:branch"
109144 cmd : |
110- branch="promote-release_{{version}}"
145+ set -eu
146+ branch="promote/release-{{version}}"
111147 git switch -c "${branch}"
112148 git commit -am 'promote-release: {{version}}' -m '{{config}}'
113149 git push origin "${branch}"
114- - name : " gh "
150+ - name : " github:pr "
115151 cmd : |
116- set -e
117- branch="wip_release -{{version}}"
152+ set -eu
153+ internal_branch="internal/release -{{version}}"
118154 # we need to fetch from origin just in case this branch doesn't exist locally, so that the PR can find the base
119- git fetch origin "${branch}"
120- gh pr create -f -t "PRETEND PROMOTE RELEASE - release: build {{version}}" --base "${branch}" --body "Test plan: automated release PR, CI will perform additional checks"
155+ git fetch origin "${internal_branch}"
156+ gh pr create \
157+ --fill \
158+ --draft \
159+ --base "$internal_branch" \
160+ --title "(promote) release: build {{version}}" \
161+ --body "Test plan: automated release PR, CI will perform additional checks"
162+ echo "🚢 Please check the associated CI build to ensure the process completed".
121163 finalize :
122164 steps :
123165 - name : git:tag
124166 cmd : |
125- set -e
126- branch="wip_release-{{version}}"
127- git checkout "${branch}"
128- git tag wip_{{version}}
129- git push origin ${branch} --tags
167+ set -eu
168+
169+ # Branches
170+ internal_branch="internal/release-{{version}}"
171+ promote_branch="promote/release-{{version}}"
172+ release_branch="release-{{version}}"
173+
174+ # Create the final branch holding the tagged commit
175+ git checkout "${promote_branch}"
176+ git switch -c "${release_branch}"
177+
178+ git tag {{version}}
179+ git push origin ${release_branch} --tags
180+
181+ # Web URL to the tag
182+ tag_url="https://github.com/sourcegraph/deploy-sourcegraph-docker/tree/{{version}}"
183+
184+ # Annotate PRs
185+ cat << EOF | gh pr comment "$internal_branch" --body-file -
186+ - :green_circle: Release has been promoted, see tag: $tag_url.
187+ - :no_entry: Do not under any circumstance delete the branch holding the tagged commit (i.e. \`$release_branch\`).
188+ - :arrow_right: You can safely close that PR and delete its a associated branch.
189+ EOF
190+
191+ cat << EOF | gh pr comment "$promote_branch" --body-file -
192+ - :green_circle: Release has been promoted, see tag: $tag_url.
193+ - :no_entry: Do not under any circumstance delete the branch holding the tagged commit (i.e. \`$release_branch\`).
194+ - :arrow_right: You can safely close that PR and delete its a associated branch.
195+ EOF
196+
197+ # Annotate build
198+ cat << EOF | buildkite-agent annotate --style info
199+ Promoted release is **publicly available** through a git tag at [\`{{version}}\`](https://github.com/sourcegraph/deploy-sourcegraph-docker/tree/{{version}}).
200+ EOF
0 commit comments