Skip to content

Commit ac00f79

Browse files
committed
Release oldstable from v3, edge from v4
1 parent bca0453 commit ac00f79

7 files changed

Lines changed: 346 additions & 59 deletions
Lines changed: 231 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,231 @@
1+
steps:
2+
- wait
3+
4+
- name: ":s3: Upload Oldstable Binaries to S3"
5+
command: ".buildkite/steps/publish-to-s3.sh"
6+
env:
7+
CODENAME: "oldstable"
8+
plugins:
9+
- aws-assume-role-with-web-identity#v1.4.0:
10+
role-arn: arn:aws:iam::032379705303:role/pipeline-buildkite-agent-release-oldstable
11+
session-tags:
12+
- organization_slug
13+
- organization_id
14+
- pipeline_slug
15+
- build_branch
16+
- ecr#v2.7.0:
17+
login: true
18+
account-ids: "032379705303"
19+
- docker#v5.8.0:
20+
environment:
21+
- "AWS_ACCESS_KEY_ID"
22+
- "AWS_SECRET_ACCESS_KEY"
23+
- "AWS_SESSION_TOKEN"
24+
image: "032379705303.dkr.ecr.us-east-1.amazonaws.com/deploytools:2022.07"
25+
propagate-environment: true
26+
mount-buildkite-agent: true
27+
28+
- name: ":octocat: :rocket: Create Github Release (if necessary)"
29+
command: ".buildkite/steps/github-release.sh"
30+
env:
31+
CODENAME: "oldstable"
32+
plugins:
33+
- aws-assume-role-with-web-identity#v1.4.0:
34+
role-arn: arn:aws:iam::032379705303:role/pipeline-buildkite-agent-release-oldstable
35+
session-tags:
36+
- organization_slug
37+
- organization_id
38+
- pipeline_slug
39+
- build_branch
40+
- ecr#v2.7.0:
41+
login: true
42+
account-ids: "032379705303"
43+
- docker#v5.8.0:
44+
environment:
45+
- "AWS_ACCESS_KEY_ID"
46+
- "AWS_SECRET_ACCESS_KEY"
47+
- "AWS_SESSION_TOKEN"
48+
image: "032379705303.dkr.ecr.us-east-1.amazonaws.com/deploytools:2022.07"
49+
propagate-environment: true
50+
mount-buildkite-agent: true
51+
52+
- name: ":redhat: Publish Oldstable RPM Package"
53+
command: ".buildkite/steps/publish-rpm-package.sh"
54+
env:
55+
CODENAME: "oldstable"
56+
RPM_S3_BUCKET: "yum.buildkite.com"
57+
plugins:
58+
- aws-assume-role-with-web-identity#v1.4.0:
59+
role-arn: arn:aws:iam::032379705303:role/pipeline-buildkite-agent-release-oldstable
60+
session-tags:
61+
- organization_slug
62+
- organization_id
63+
- pipeline_slug
64+
- build_branch
65+
- docker#v5.8.0:
66+
environment:
67+
- "AWS_ACCESS_KEY_ID"
68+
- "AWS_SECRET_ACCESS_KEY"
69+
- "AWS_SESSION_TOKEN"
70+
image: "buildkite/agent:3.55.0-ubuntu"
71+
entrypoint: bash
72+
propagate-environment: true
73+
mount-buildkite-agent: true
74+
volumes:
75+
- "/yum.buildkite.com"
76+
retry:
77+
automatic:
78+
- exit_status: 1
79+
limit: 3
80+
81+
- group: ":redhat: Publish Oldstable RPM Package to Buildkite Packages"
82+
steps:
83+
- name: ":redhat: Publish Oldstable {{matrix.pkg_arch}} RPM Package to Buildkite Packages"
84+
plugins:
85+
- publish-to-packages#v2.2.0:
86+
artifacts: "rpm/buildkite-agent_*_{{matrix.pkg_arch}}.rpm"
87+
registry: "buildkite/agent-rpm-oldstable"
88+
artifact_build_id: "${BUILDKITE_TRIGGERED_FROM_BUILD_ID}"
89+
attestations:
90+
- "buildkite-agent-linux-{{matrix.go_arch}}.build-attestation.json"
91+
- "buildkite-agent-rpm-packages.package-attestation.json"
92+
soft_fail: true
93+
matrix:
94+
setup:
95+
go_arch:
96+
- "amd64"
97+
- "386"
98+
- "arm64"
99+
- "ppc64"
100+
- "ppc64le"
101+
- "riscv64"
102+
pkg_arch:
103+
- "SKIP_FAKE_ARCH"
104+
adjustments:
105+
- with: { go_arch: "amd64", pkg_arch: "x86_64" }
106+
- with: { go_arch: "386", pkg_arch: "i386" }
107+
- with: { go_arch: "arm64", pkg_arch: "aarch64" }
108+
- with: { go_arch: "ppc64", pkg_arch: "ppc64" }
109+
- with: { go_arch: "ppc64le", pkg_arch: "ppc64le" }
110+
- with: { go_arch: "riscv64", pkg_arch: "riscv64" }
111+
- with: { pkg_arch: "SKIP_FAKE_ARCH" }
112+
skip: true
113+
114+
- name: ":debian: Publish Oldstable Debian Package"
115+
command: ".buildkite/steps/publish-debian-package.sh"
116+
env:
117+
CODENAME: "oldstable"
118+
DEB_S3_BUCKET: "apt.buildkite.com/buildkite-agent"
119+
plugins:
120+
- aws-assume-role-with-web-identity#v1.4.0:
121+
role-arn: arn:aws:iam::032379705303:role/pipeline-buildkite-agent-release-oldstable
122+
session-tags:
123+
- organization_slug
124+
- organization_id
125+
- pipeline_slug
126+
- build_branch
127+
- ecr#v2.7.0:
128+
login: true
129+
account-ids: "032379705303"
130+
- docker#v5.8.0:
131+
environment:
132+
- "AWS_ACCESS_KEY_ID"
133+
- "AWS_SECRET_ACCESS_KEY"
134+
- "AWS_SESSION_TOKEN"
135+
image: "032379705303.dkr.ecr.us-east-1.amazonaws.com/deploytools:2022.07"
136+
propagate-environment: true
137+
mount-buildkite-agent: true
138+
tmpfs:
139+
- "/root/.gnupg"
140+
141+
- group: ":debian: Publish Oldstable Debian Package to Buildkite Packages"
142+
steps:
143+
- name: ":debian: Publish Oldstable {{matrix.pkg_arch}} Debian Package to Buildkite Packages"
144+
plugins:
145+
- publish-to-packages#v2.2.0:
146+
artifacts: "deb/buildkite-agent_*_{{matrix.pkg_arch}}.deb"
147+
registry: "buildkite/agent-deb-oldstable"
148+
artifact_build_id: "${BUILDKITE_TRIGGERED_FROM_BUILD_ID}"
149+
attestations:
150+
- "buildkite-agent-linux-{{matrix.go_arch}}.build-attestation.json"
151+
- "buildkite-agent-debian-packages.package-attestation.json"
152+
soft_fail: true
153+
matrix:
154+
setup:
155+
go_arch:
156+
- "amd64"
157+
- "386"
158+
- "arm"
159+
- "armhf"
160+
- "arm64"
161+
- "ppc64"
162+
- "ppc64le"
163+
- "riscv64"
164+
pkg_arch:
165+
- "SKIP_FAKE_ARCH"
166+
adjustments:
167+
- with: { go_arch: "amd64", pkg_arch: "x86_64" }
168+
- with: { go_arch: "386", pkg_arch: "i386" }
169+
- with: { go_arch: "arm", pkg_arch: "arm" }
170+
- with: { go_arch: "armhf", pkg_arch: "armhf" }
171+
- with: { go_arch: "arm64", pkg_arch: "arm64" }
172+
- with: { go_arch: "ppc64", pkg_arch: "ppc64" }
173+
- with: { go_arch: "ppc64le", pkg_arch: "ppc64el" }
174+
- with: { go_arch: "riscv64", pkg_arch: "riscv64" }
175+
- with: { pkg_arch: "SKIP_FAKE_ARCH" }
176+
skip: true
177+
178+
- group: ":docker: Publish Oldstable Docker Images"
179+
steps:
180+
- name: ":docker: Publish Oldstable Images to {{matrix.registry}}"
181+
command: ".buildkite/steps/publish-docker-images.sh"
182+
env:
183+
CODENAME: "oldstable"
184+
REGISTRY: "{{matrix.registry}}"
185+
plugins:
186+
- aws-assume-role-with-web-identity#v1.4.0:
187+
role-arn: arn:aws:iam::032379705303:role/pipeline-buildkite-agent-release-oldstable
188+
session-tags:
189+
- organization_slug
190+
- organization_id
191+
- pipeline_slug
192+
- build_branch
193+
- ecr#v2.7.0:
194+
login: true
195+
account-ids: "445615400570"
196+
matrix:
197+
setup:
198+
registry:
199+
- docker.io
200+
- ghcr.io
201+
- packages.buildkite.com
202+
adjustments:
203+
- with: { registry: "packages.buildkite.com" }
204+
soft_fail: true
205+
206+
- wait
207+
208+
- name: ":beer: Publish Oldstable Homebrew Package"
209+
command: ".buildkite/steps/release-homebrew.sh"
210+
artifact_paths: "pkg/*.rb;pkg/*.json"
211+
env:
212+
CODENAME: "oldstable"
213+
plugins:
214+
- aws-assume-role-with-web-identity#v1.4.0:
215+
role-arn: arn:aws:iam::032379705303:role/pipeline-buildkite-agent-release-oldstable
216+
session-tags:
217+
- organization_slug
218+
- organization_id
219+
- pipeline_slug
220+
- build_branch
221+
- ecr#v2.7.0:
222+
login: true
223+
account-ids: "032379705303"
224+
- docker#v5.8.0:
225+
environment:
226+
- "AWS_ACCESS_KEY_ID"
227+
- "AWS_SECRET_ACCESS_KEY"
228+
- "AWS_SESSION_TOKEN"
229+
image: "032379705303.dkr.ecr.us-east-1.amazonaws.com/deploytools:2022.07"
230+
propagate-environment: true
231+
mount-buildkite-agent: true

.buildkite/steps/github-release.sh

Lines changed: 36 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,16 @@ dry_run() {
1010
}
1111

1212
echo '--- Getting credentials from SSM'
13-
GH_TOKEN=$(aws ssm get-parameter --name /pipelines/agent/GITHUB_RELEASE_ACCESS_TOKEN --with-decryption --output text --query Parameter.Value --region us-east-1)
13+
GH_TOKEN="$(aws ssm get-parameter \
14+
--name /pipelines/agent/GITHUB_RELEASE_ACCESS_TOKEN \
15+
--with-decryption \
16+
--output text \
17+
--query Parameter.Value \
18+
--region us-east-1 \
19+
)"
1420
export GH_TOKEN
1521

16-
if [[ "$GH_TOKEN" == "" ]]; then
22+
if [[ "${GH_TOKEN}" == "" ]]; then
1723
echo "Error: Missing \$GH_TOKEN"
1824
exit 1
1925
fi
@@ -27,57 +33,65 @@ gh --version
2733

2834
echo '--- Getting agent version from build meta data'
2935

30-
export FULL_AGENT_VERSION=$(buildkite-agent meta-data get "agent-version-full")
31-
export AGENT_VERSION=$(buildkite-agent meta-data get "agent-version")
32-
export BUILD_VERSION=$(buildkite-agent meta-data get "agent-version-build")
33-
export IS_PRERELEASE=$(buildkite-agent meta-data get "agent-is-prerelease")
36+
export FULL_AGENT_VERSION="$(buildkite-agent meta-data get "agent-version-full")"
37+
export AGENT_VERSION="$(buildkite-agent meta-data get "agent-version")"
38+
export BUILD_VERSION="$(buildkite-agent meta-data get "agent-version-build")"
39+
export IS_PRERELEASE="$(buildkite-agent meta-data get "agent-is-prerelease")"
3440

35-
echo "Full agent version: $FULL_AGENT_VERSION"
36-
echo "Agent version: $AGENT_VERSION"
37-
echo "Build version: $BUILD_VERSION"
38-
echo "Is prerelease?: $IS_PRERELEASE"
41+
echo "Full agent version: ${FULL_AGENT_VERSION}"
42+
echo "Agent version: ${AGENT_VERSION}"
43+
echo "Build version: ${BUILD_VERSION}"
44+
echo "Is prerelease?: ${IS_PRERELEASE}"
3945

40-
if [[ "$CODENAME" == "unstable" && "$IS_PRERELEASE" == "0" ]] ; then
41-
echo "Skipping github release, will happen in stable pipeline"
46+
if [[ "${CODENAME}" == "unstable" && "${IS_PRERELEASE}" == "0" ]] ; then
47+
echo "Skipping github release, will happen in stable/oldstable pipeline"
4248
exit 0
4349
fi
4450

45-
if [[ "$CODENAME" == "stable" && "$IS_PRERELEASE" == "1" ]] ; then
51+
if [[ ("${CODENAME}" == "stable" || "${CODENAME}" == "oldstable") && "${IS_PRERELEASE}" == "1" ]] ; then
4652
echo "Skipping github release, should have happened in unstable pipeline"
4753
exit 0
4854
fi
4955

5056
echo '--- Downloading releases'
5157

52-
artifacts_build=$(buildkite-agent meta-data get "agent-artifacts-build")
58+
artifacts_build="$(buildkite-agent meta-data get "agent-artifacts-build")"
5359

5460
rm -rf releases
5561
mkdir -p releases
56-
buildkite-agent artifact download --build "$artifacts_build" "releases/*" .
62+
buildkite-agent artifact download --build "${artifacts_build}" "releases/*" .
5763

58-
echo "Version is $FULL_AGENT_VERSION"
64+
echo "Version is ${FULL_AGENT_VERSION}"
5965

6066
release_args=(
61-
"v$AGENT_VERSION"
67+
"v${AGENT_VERSION}"
6268
releases/*
6369
--repo buildkite/agent
6470
--target "$(git rev-parse HEAD)"
6571
--generate-notes
6672
--fail-on-no-commits
6773
)
6874

69-
if [[ "$IS_PRERELEASE" == "1" ]]; then
70-
echo "--- 🚀 $AGENT_VERSION (prerelease)"
75+
if [[ "${IS_PRERELEASE}" == "1" ]]; then
76+
echo "--- 🚀 ${AGENT_VERSION} (prerelease)"
7177

7278
buildkite-agent meta-data set github_release_type "prerelease"
73-
buildkite-agent meta-data set github_release_version "$AGENT_VERSION"
7479

7580
release_args+=(--prerelease)
81+
82+
elif [[ "${CODENAME}" == "oldstable" ]]; then
83+
echo "--- 🚀 ${AGENT_VERSION} (oldstable)"
84+
85+
buildkite-agent meta-data set github_release_type "stable"
86+
87+
release_args+=(--latest=false)
88+
7689
else
77-
echo "--- 🚀 $AGENT_VERSION"
90+
echo "--- 🚀 ${AGENT_VERSION}"
7891

7992
buildkite-agent meta-data set github_release_type "stable"
80-
buildkite-agent meta-data set github_release_version "$AGENT_VERSION"
8193
fi
8294

95+
buildkite-agent meta-data set github_release_version "${AGENT_VERSION}"
96+
8397
dry_run gh release create "${release_args[@]}"

0 commit comments

Comments
 (0)