Skip to content

Commit 73a4653

Browse files
burmudarjhchabran
andauthored
rfc-795: add release manifest (#88)
* Test the finalize step * finalize with config from commit * Wait before doing any finalization * Add test placeholder * add release test phase * upup * Fix manifest * small changes before internal build test * fixup pin tag * add promote to public build step * fix pipeline * add finalize step for promotion * fix finalization * fix promote finalize pipeline conditional * Add missing test plan for automated PR * Also push executors * add steps for minor and major --------- Co-authored-by: Jean-Hadrien Chabran <[email protected]>
1 parent c62974a commit 73a4653

File tree

2 files changed

+229
-0
lines changed

2 files changed

+229
-0
lines changed

.buildkite/pipeline.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,31 @@ steps:
2222
- label: ":k8s:"
2323
command: .buildkite/verify-overlays.sh
2424
agents: { queue: standard }
25+
26+
- label: "Release: test"
27+
if: "build.branch =~ /^wip_/"
28+
command: |
29+
wget https://storage.googleapis.com/buildkite_public_assets/sg-rfc795.tar.gz
30+
tar zxf sg-rfc795.tar.gz
31+
chmod +x ./sg-rfc795
32+
33+
./sg-rfc795 release run test --workdir=. --config-from-commit
34+
35+
- wait
36+
37+
- label: "Release: finalize"
38+
if: "build.branch =~ /^wip_/"
39+
command: |
40+
wget https://storage.googleapis.com/buildkite_public_assets/sg-rfc795.tar.gz
41+
tar zxf sg-rfc795.tar.gz
42+
chmod +x ./sg-rfc795
43+
44+
./sg-rfc795 release run internal finalize --workdir=. --config-from-commit
45+
- label: "Promote to public: finalize"
46+
if: build.message =~ /^promote_release/ && build.branch =~ /^wip-release/
47+
command: |
48+
wget https://storage.googleapis.com/buildkite_public_assets/sg-rfc795.tar.gz
49+
tar zxf sg-rfc795.tar.gz
50+
chmod +x ./sg-rfc795
51+
52+
./sg-rfc795 release run promote-to-public finalize --workdir=. --config-from-commit

release.yaml

Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
meta:
2+
productName: deploy-sourcegraph-k8s
3+
repository: "github.com/sourcegraph/deploy-sourcegraph-k8s"
4+
owners:
5+
- "@sourcegraph/release"
6+
7+
inputs:
8+
- releaseId: server
9+
10+
requirements:
11+
- name: "Github CLI"
12+
cmd: gh version
13+
fixInstructions: brew install gh
14+
- name: "Docker username"
15+
env: DOCKER_USERNAME
16+
- name: "Docker password"
17+
env: DOCKER_PASSWORD
18+
19+
internal:
20+
create:
21+
steps:
22+
patch:
23+
- name: "sg ops (base)"
24+
cmd: |
25+
sg-rfc795 ops update-images \
26+
--kind k8s \
27+
--registry us-central1-docker.pkg.dev/sourcegraph-ci/rfc795-internal \
28+
--docker-username=$DOCKER_USERNAME \
29+
--docker-password=$DOCKER_PASSWORD \
30+
--pin-tag {{inputs.server.tag}} \
31+
base/
32+
- name: "sg ops (executors)"
33+
cmd: |
34+
sg-rfc795 ops update-images \
35+
--kind k8s \
36+
--registry us-central1-docker.pkg.dev/sourcegraph-ci/rfc795-internal \
37+
--docker-username=$DOCKER_USERNAME \
38+
--docker-password=$DOCKER_PASSWORD \
39+
--pin-tag {{inputs.server.tag}} \
40+
components/executors/
41+
- name: "git:branch"
42+
cmd: |
43+
echo "Creating branch wip_{{version}}"
44+
release_branch="wip_{{version}}"
45+
git checkout -b $release_branch
46+
- name: "git:commit"
47+
cmd: |
48+
find . -name "*.yaml" | xargs git add
49+
find . -name "*.yml" | xargs git add
50+
# Careful with the quoting for the config, using double quotes will lead
51+
# to the shell dropping out all quotes from the json, leading to failed
52+
# parsing.
53+
git commit -m "release_patch: {{version}}" -m '{{config}}'
54+
- name: "git:push"
55+
cmd: |
56+
git push origin wip_{{version}}
57+
- name: "gh cli"
58+
cmd: |
59+
gh pr create -f -t "PRETEND RELEASE WIP: release_patch: build {{version}}" --body "Test plan: automated release PR, CI will perform additional checks" # -l "wip_release"
60+
minor:
61+
- name: "sg ops (base)"
62+
cmd: |
63+
sg-rfc795 ops update-images \
64+
--kind k8s \
65+
--registry us-central1-docker.pkg.dev/sourcegraph-ci/rfc795-internal \
66+
--docker-username=$DOCKER_USERNAME \
67+
--docker-password=$DOCKER_PASSWORD \
68+
--pin-tag {{inputs.server.tag}} \
69+
base/
70+
- name: "sg ops (executors)"
71+
cmd: |
72+
sg-rfc795 ops update-images \
73+
--kind k8s \
74+
--registry us-central1-docker.pkg.dev/sourcegraph-ci/rfc795-internal \
75+
--docker-username=$DOCKER_USERNAME \
76+
--docker-password=$DOCKER_PASSWORD \
77+
--pin-tag {{inputs.server.tag}} \
78+
components/executors/
79+
- name: "git:branch"
80+
cmd: |
81+
echo "Creating branch wip_{{version}}"
82+
release_branch="wip_{{version}}"
83+
git checkout -b $release_branch
84+
- name: "git:commit"
85+
cmd: |
86+
find . -name "*.yaml" | xargs git add
87+
find . -name "*.yml" | xargs git add
88+
# Careful with the quoting for the config, using double quotes will lead
89+
# to the shell dropping out all quotes from the json, leading to failed
90+
# parsing.
91+
git commit -m "release_minor: {{version}}" -m '{{config}}'
92+
- name: "git:push"
93+
cmd: |
94+
git push origin wip_{{version}}
95+
- name: "gh cli"
96+
cmd: |
97+
gh pr create -f -t "PRETEND RELEASE WIP: release_minor: build {{version}}" --body "Test plan: automated release PR, CI will perform additional checks" # -l "wip_release"
98+
major:
99+
- name: "sg ops (base)"
100+
cmd: |
101+
sg-rfc795 ops update-images \
102+
--kind k8s \
103+
--registry us-central1-docker.pkg.dev/sourcegraph-ci/rfc795-internal \
104+
--docker-username=$DOCKER_USERNAME \
105+
--docker-password=$DOCKER_PASSWORD \
106+
--pin-tag {{inputs.server.tag}} \
107+
base/
108+
- name: "sg ops (executors)"
109+
cmd: |
110+
sg-rfc795 ops update-images \
111+
--kind k8s \
112+
--registry us-central1-docker.pkg.dev/sourcegraph-ci/rfc795-internal \
113+
--docker-username=$DOCKER_USERNAME \
114+
--docker-password=$DOCKER_PASSWORD \
115+
--pin-tag {{inputs.server.tag}} \
116+
components/executors/
117+
- name: "git:branch"
118+
cmd: |
119+
echo "Creating branch wip_{{version}}"
120+
release_branch="wip_{{version}}"
121+
git checkout -b $release_branch
122+
- name: "git:commit"
123+
cmd: |
124+
find . -name "*.yaml" | xargs git add
125+
find . -name "*.yml" | xargs git add
126+
# Careful with the quoting for the config, using double quotes will lead
127+
# to the shell dropping out all quotes from the json, leading to failed
128+
# parsing.
129+
git commit -m "release_patch: {{version}}" -m '{{config}}'
130+
- name: "git:push"
131+
cmd: |
132+
git push origin wip_{{version}}
133+
- name: "gh cli"
134+
cmd: |
135+
gh pr create -f -t "PRETEND RELEASE WIP: release_major: build {{version}}" --body "Test plan: automated release PR, CI will perform additional checks" # -l "wip_release"
136+
finalize:
137+
steps:
138+
- name: "git"
139+
cmd: |
140+
git checkout -b wip-release-{{version}}
141+
git push origin wip-release-{{version}}
142+
git checkout -
143+
144+
test:
145+
steps:
146+
- name: "placeholder"
147+
cmd: |
148+
echo "-- pretending to test release ..."
149+
150+
promoteToPublic:
151+
create:
152+
steps:
153+
- name: "git"
154+
cmd: |
155+
echo "Checking out origin/wip-release-{{version}}"
156+
git fetch origin
157+
git checkout origin/wip-release-{{version}}
158+
- name: "sg ops"
159+
cmd: |
160+
sg-rfc795 ops update-images \
161+
--kind k8s \
162+
--registry us-central1-docker.pkg.dev/sourcegraph-ci/rfc795-public \
163+
--docker-username=$DOCKER_USERNAME \
164+
--docker-password=$DOCKER_PASSWORD \
165+
--pin-tag {{inputs.server.tag}} \
166+
base/
167+
- name: "sg ops (executors)"
168+
cmd: |
169+
sg-rfc795 ops update-images \
170+
--kind k8s \
171+
--registry us-central1-docker.pkg.dev/sourcegraph-ci/rfc795-public \
172+
--docker-username=$DOCKER_USERNAME \
173+
--docker-password=$DOCKER_PASSWORD \
174+
--pin-tag {{inputs.server.tag}} \
175+
components/executors/
176+
- name: "git:branch"
177+
cmd: |
178+
echo "Creating branch promote-release_{{version}}"
179+
branch="promote-release_{{version}}"
180+
git checkout -b $branch
181+
- name: "git:commit"
182+
cmd: |
183+
find . -name "*.yaml" | xargs git add
184+
find . -name "*.yml" | xargs git add
185+
# Careful with the quoting for the config, using double quotes will lead
186+
# to the shell dropping out all quotes from the json, leading to failed
187+
# parsing.
188+
git commit -m "promote_release: {{version}}" -m '{{config}}'
189+
- name: "github"
190+
cmd: |
191+
git push origin promote-release_{{version}}
192+
gh pr create -f -t "PRETEND PROMOTE RELEASE WIP: promote-release: build {{version}}" --base wip-release-{{version}} --body "Test plan: automated release PR, CI will perform additional checks"
193+
finalize:
194+
# These steps should only really run once the pr created in the create step is merged
195+
steps:
196+
- name: git:tag
197+
cmd: |
198+
branch="wip-release-{{version}}"
199+
git checkout ${branch}
200+
git tag {{version}}
201+
git push origin ${branch} --tags

0 commit comments

Comments
 (0)