Skip to content

Commit ae4d463

Browse files
authored
Update release manifest + QA (#1008)
1 parent eeddc30 commit ae4d463

File tree

5 files changed

+134
-43
lines changed

5 files changed

+134
-43
lines changed

.buildkite/hooks/pre-command

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,5 @@ fi
2626
trap remove_pidfile EXIT
2727
echo $$ > "$PIDFILE"
2828

29-
3029
echo "Installing asdf dependencies as defined in '${WORKDIR}/.tool-versions':"
3130
asdf install

.buildkite/pipeline.yaml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,25 +36,37 @@ steps:
3636
agents: { queue: "standard" }
3737
soft_fail: true
3838

39-
- label: "Release: test"
40-
if: "build.branch =~ /^wip_/"
39+
# Please keep in mind that the release manifest uses specific branch names when creating releases.
40+
# Therefore, if you update them, or if you decide to change how we detect what kind of build we're dealing
41+
# with, please update this file as well.
42+
- label: "(internal) Release: test"
43+
if: build.branch =~ /^internal\/release-.*/
44+
plugins:
45+
- ssh://[email protected]/sourcegraph/sg-buildkite-plugin.git#main: ~
46+
command: |
47+
sg release run test --workdir=. --config-from-commit
48+
49+
- label: "(promote) Release: test"
50+
if: build.branch =~ /^promote\/release-.*/
4151
plugins:
4252
- ssh://[email protected]/sourcegraph/sg-buildkite-plugin.git#main: ~
4353
command: |
4454
sg release run test --workdir=. --config-from-commit
4555
4656
- wait
4757

48-
- label: "Release: finalize"
49-
if: "build.branch =~ /^wip_/"
58+
- label: "(internal) Release: finalize"
59+
if: build.branch =~ /^internal\/release-.*/
5060
plugins:
5161
- ssh://[email protected]/sourcegraph/sg-buildkite-plugin.git#main: ~
5262
command: |
5363
sg release run internal finalize --workdir=. --config-from-commit
5464
55-
- label: "Promote to public: finalize"
56-
if: build.message =~ /^promote_release/ && build.branch =~ /^wip_release/
65+
66+
- label: "(promote) Release: finalize"
67+
if: build.branch =~ /^promote\/release-.*/
5768
plugins:
5869
- ssh://[email protected]/sourcegraph/sg-buildkite-plugin.git#main: ~
5970
command: |
6071
sg release run promote-to-public finalize --workdir=. --config-from-commit
72+

.tool-versions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ nodejs 16.7.0
22
yarn 1.22.4
33
shellcheck 0.7.1
44
golang 1.19.8
5+
github-cli 2.46.0
56
python system

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,11 @@ We've made our deployment configurations open source to better serve our custome
3434
What if your organization wants a multi-machine deployment without using Kubernetes?
3535
What if you use a different container management platform, for example?
3636
Anyone using a container management platform other than Kubernetes (Netflix's [Titus](https://netflix.github.io/titus/), Apache's [Mesos](http://mesos.apache.org/documentation/latest/docker-containerizer/), etc.) can use our [Pure-Docker Sourcegraph cluster deployment reference](./pure-docker/README.md) to deploy Sourcegraph.
37+
38+
---
39+
40+
### Contributing
41+
42+
#### Releasing
43+
44+
Please see the [documentation](https://go/releases).

release.yaml

Lines changed: 107 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ meta:
55
- "@sourcegraph/release"
66
repository: "github.com/sourcegraph/deploy-sourcegraph-docker"
77
inputs:
8-
releaseId: server
8+
- releaseId: server
99
requirements:
1010
- name: "go"
1111
cmd: "which go"
@@ -14,116 +14,187 @@ requirements:
1414
cmd: "which gh"
1515
fixInstructions: "install GitHub cli"
1616
internal:
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
89118
test:
90119
steps:
91-
- name: "foo"
120+
- name: "Placeholder"
92121
cmd: |
93122
echo "Test"
94123
95124
promoteToPublic:
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

Comments
 (0)