Skip to content

Commit 53f3656

Browse files
committed
Merge branch 'main' into fix_osx_sed_in_makefile
2 parents d6abf82 + e56ff08 commit 53f3656

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+2443
-285
lines changed

.buildkite/docker-compose.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,19 @@ version: '3'
22

33
services:
44
fixperms-tests:
5-
image: golang:1.22
5+
image: golang:1.24
66
working_dir: /code
77
environment:
88
CGO_ENABLED: 0
99
volumes:
1010
- ..:/code:ro
1111
command: go test -v ./...
12+
13+
ruby:
14+
image: ruby:3.4
15+
working_dir: /work
16+
environment:
17+
- DRY_RUN
18+
- AWS_REGION
19+
volumes:
20+
- ..:/work:ro

.buildkite/pipeline.cleanamis.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
steps:
2+
- name: ":broom: Delete AMIs ({{matrix}})"
3+
command: .buildkite/steps/clean-old-amis
4+
agents:
5+
queue: "oss-deploy"
6+
env:
7+
# DRY_RUN: true
8+
AWS_REGION: "{{matrix}}"
9+
# list of regions should match .buildkite/steps/copy.sh
10+
matrix:
11+
- "us-east-1"
12+
- "us-east-2"
13+
- "us-west-1"
14+
- "us-west-2"
15+
- "af-south-1"
16+
- "ap-east-1"
17+
- "ap-south-1"
18+
- "ap-northeast-2"
19+
- "ap-northeast-1"
20+
- "ap-southeast-2"
21+
- "ap-southeast-1"
22+
- "ca-central-1"
23+
- "eu-central-1"
24+
- "eu-west-1"
25+
- "eu-west-2"
26+
- "eu-south-1"
27+
- "eu-west-3"
28+
- "eu-north-1"
29+
- "me-south-1"
30+
- "sa-east-1"
31+
plugins:
32+
- aws-assume-role-with-web-identity#v1.4.0:
33+
role-arn: arn:aws:iam::172840064832:role/pipeline-buildkite-elastic-stack-for-aws-ami-cleaner
34+
session-tags:
35+
- organization_slug
36+
- organization_id
37+
- pipeline_slug
38+
- branch_build
39+
- docker-compose#v5.10.0:
40+
run: ruby
41+
config: .buildkite/docker-compose.yml
42+
propagate-aws-auth-tokens: true

.buildkite/pipeline.yaml

Lines changed: 115 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@ steps:
77
agents:
88
queue: "${BUILDKITE_AGENT_META_DATA_QUEUE}"
99

10+
- id: "cfn-lint"
11+
name: ":mag: cfn-lint"
12+
command: .buildkite/steps/cfn-lint.sh
13+
agents:
14+
queue: "${BUILDKITE_AGENT_META_DATA_QUEUE}"
15+
soft_fail:
16+
# https://github.com/aws-cloudformation/cfn-lint#exit-codes
17+
- exit_status: 4 # Warning
18+
- exit_status: 8 # Informational
19+
- exit_status: 12 # Warning and informational
20+
1021
- label: ":bash: shfmt"
1122
key: fmt
1223
command: .buildkite/steps/shfmt.sh
@@ -18,7 +29,7 @@ steps:
1829
agents:
1930
queue: "${BUILDKITE_AGENT_META_DATA_QUEUE}"
2031
plugins:
21-
- docker-compose#v2.1.0:
32+
- docker-compose#v5.10.0:
2233
run: fixperms-tests
2334
config: .buildkite/docker-compose.yml
2435

@@ -30,7 +41,15 @@ steps:
3041
depends_on:
3142
- "fmt"
3243
- "lint"
44+
- "cfn-lint"
3345
- "fixperms-tests"
46+
plugins:
47+
- aws-assume-role-with-web-identity#v1.4.0:
48+
role-arn: arn:aws:iam::172840064832:role/pipeline-buildkite-aws-stack-buildkite-aws-stack
49+
session-tags:
50+
- organization_slug
51+
- organization_id
52+
- pipeline_slug
3453

3554
- id: "packer-windows-amd64"
3655
name: ":packer: :windows:"
@@ -42,7 +61,15 @@ steps:
4261
depends_on:
4362
- "fmt"
4463
- "lint"
64+
- "cfn-lint"
4565
- "fixperms-tests"
66+
plugins:
67+
- aws-assume-role-with-web-identity#v1.4.0:
68+
role-arn: arn:aws:iam::172840064832:role/pipeline-buildkite-aws-stack-buildkite-aws-stack
69+
session-tags:
70+
- organization_slug
71+
- organization_id
72+
- pipeline_slug
4673

4774
- id: "launch-windows-amd64"
4875
name: ":cloudformation: :windows: AMD64 Launch"
@@ -53,13 +80,20 @@ steps:
5380
depends_on:
5481
- "packer-windows-amd64"
5582
- "deploy-service-role-stack"
83+
plugins:
84+
- aws-assume-role-with-web-identity#v1.4.0:
85+
role-arn: arn:aws:iam::172840064832:role/pipeline-buildkite-aws-stack-buildkite-aws-stack
86+
session-tags:
87+
- organization_slug
88+
- organization_id
89+
- pipeline_slug
5690

5791
- id: "test-windows-amd64"
5892
name: ":cloudformation: :windows: AMD64 Test"
5993
command:
6094
- git --version
6195
- docker info
62-
- docker run --rm mcr.microsoft.com/windows/nanoserver:ltsc2019 cmd.exe /c echo hello
96+
- docker run --rm mcr.microsoft.com/windows/nanoserver:ltsc2022 cmd.exe /c echo hello
6397
timeout_in_minutes: 5
6498
agents:
6599
stack: "buildkite-aws-stack-test-windows-amd64-${BUILDKITE_BUILD_NUMBER}"
@@ -75,6 +109,13 @@ steps:
75109
queue: "${BUILDKITE_AGENT_META_DATA_QUEUE}"
76110
depends_on:
77111
- "test-windows-amd64"
112+
plugins:
113+
- aws-assume-role-with-web-identity#v1.4.0:
114+
role-arn: arn:aws:iam::172840064832:role/pipeline-buildkite-aws-stack-buildkite-aws-stack
115+
session-tags:
116+
- organization_slug
117+
- organization_id
118+
- pipeline_slug
78119

79120
- id: "packer-linux-amd64"
80121
name: ":packer: :linux: AMD64"
@@ -86,7 +127,15 @@ steps:
86127
depends_on:
87128
- "fmt"
88129
- "lint"
130+
- "cfn-lint"
89131
- "fixperms-tests"
132+
plugins:
133+
- aws-assume-role-with-web-identity#v1.4.0:
134+
role-arn: arn:aws:iam::172840064832:role/pipeline-buildkite-aws-stack-buildkite-aws-stack
135+
session-tags:
136+
- organization_slug
137+
- organization_id
138+
- pipeline_slug
90139

91140
- id: "launch-linux-amd64"
92141
name: ":cloudformation: :linux: AMD64 Launch"
@@ -97,6 +146,13 @@ steps:
97146
depends_on:
98147
- "packer-linux-amd64"
99148
- "deploy-service-role-stack"
149+
plugins:
150+
- aws-assume-role-with-web-identity#v1.4.0:
151+
role-arn: arn:aws:iam::172840064832:role/pipeline-buildkite-aws-stack-buildkite-aws-stack
152+
session-tags:
153+
- organization_slug
154+
- organization_id
155+
- pipeline_slug
100156

101157
- id: "test-linux-amd64"
102158
name: ":cloudformation: :linux: AMD64 Test"
@@ -118,6 +174,13 @@ steps:
118174
queue: "${BUILDKITE_AGENT_META_DATA_QUEUE}"
119175
depends_on:
120176
- "test-linux-amd64"
177+
plugins:
178+
- aws-assume-role-with-web-identity#v1.4.0:
179+
role-arn: arn:aws:iam::172840064832:role/pipeline-buildkite-aws-stack-buildkite-aws-stack
180+
session-tags:
181+
- organization_slug
182+
- organization_id
183+
- pipeline_slug
121184

122185
- id: "packer-linux-arm64"
123186
name: ":packer: :linux: ARM64"
@@ -129,7 +192,15 @@ steps:
129192
depends_on:
130193
- "fmt"
131194
- "lint"
195+
- "cfn-lint"
132196
- "fixperms-tests"
197+
plugins:
198+
- aws-assume-role-with-web-identity#v1.4.0:
199+
role-arn: arn:aws:iam::172840064832:role/pipeline-buildkite-aws-stack-buildkite-aws-stack
200+
session-tags:
201+
- organization_slug
202+
- organization_id
203+
- pipeline_slug
133204

134205
- id: "launch-linux-arm64"
135206
name: ":cloudformation: :linux: ARM64 Launch"
@@ -140,6 +211,13 @@ steps:
140211
depends_on:
141212
- "packer-linux-arm64"
142213
- "deploy-service-role-stack"
214+
plugins:
215+
- aws-assume-role-with-web-identity#v1.4.0:
216+
role-arn: arn:aws:iam::172840064832:role/pipeline-buildkite-aws-stack-buildkite-aws-stack
217+
session-tags:
218+
- organization_slug
219+
- organization_id
220+
- pipeline_slug
143221

144222
- id: "test-linux-arm64"
145223
name: ":cloudformation: :linux: ARM64 Test"
@@ -161,6 +239,13 @@ steps:
161239
queue: "${BUILDKITE_AGENT_META_DATA_QUEUE}"
162240
depends_on:
163241
- "test-linux-arm64"
242+
plugins:
243+
- aws-assume-role-with-web-identity#v1.4.0:
244+
role-arn: arn:aws:iam::172840064832:role/pipeline-buildkite-aws-stack-buildkite-aws-stack
245+
session-tags:
246+
- organization_slug
247+
- organization_id
248+
- pipeline_slug
164249

165250
- id: "delete-service-role-stack"
166251
name: ":aws-iam: :cloudformation: Delete"
@@ -171,6 +256,13 @@ steps:
171256
- "delete-windows-amd64"
172257
- "delete-linux-amd64"
173258
- "delete-linux-arm64"
259+
plugins:
260+
- aws-assume-role-with-web-identity#v1.4.0:
261+
role-arn: arn:aws:iam::172840064832:role/pipeline-buildkite-aws-stack-buildkite-aws-stack
262+
session-tags:
263+
- organization_slug
264+
- organization_id
265+
- pipeline_slug
174266

175267
- id: "copy-ami"
176268
name: ":cloudformation: 🚚 🌎"
@@ -182,6 +274,13 @@ steps:
182274
- "test-linux-amd64"
183275
- "test-linux-arm64"
184276
- "test-windows-amd64"
277+
plugins:
278+
- aws-assume-role-with-web-identity#v1.4.0:
279+
role-arn: arn:aws:iam::172840064832:role/pipeline-buildkite-aws-stack-buildkite-aws-stack
280+
session-tags:
281+
- organization_slug
282+
- organization_id
283+
- pipeline_slug
185284

186285
- id: "publish"
187286
name: ":cloudformation: :rocket:"
@@ -193,10 +292,24 @@ steps:
193292
concurrency_method: eager
194293
artifact_paths: "build/*.yml"
195294
depends_on: "copy-ami"
295+
plugins:
296+
- aws-assume-role-with-web-identity#v1.4.0:
297+
role-arn: arn:aws:iam::172840064832:role/pipeline-buildkite-aws-stack-buildkite-aws-stack
298+
session-tags:
299+
- organization_slug
300+
- organization_id
301+
- pipeline_slug
196302

197303
- id: cleanup
198304
name: ":broom: Cleanup"
199305
command: .buildkite/steps/cleanup.sh
200306
agents:
201307
queue: "${BUILDKITE_AGENT_META_DATA_QUEUE}"
202308
depends_on: "publish"
309+
plugins:
310+
- aws-assume-role-with-web-identity#v1.4.0:
311+
role-arn: arn:aws:iam::172840064832:role/pipeline-buildkite-aws-stack-buildkite-aws-stack
312+
session-tags:
313+
- organization_slug
314+
- organization_id
315+
- pipeline_slug
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
if [[ -z "${1:-}" ]]; then
5+
echo "Usage: $0 <VERSION>"
6+
echo "Example: $0 v5.5.0"
7+
exit 1
8+
fi
9+
10+
RELEASE_VERSION=$1
11+
12+
# 1. Get the previous release tag, excluding the current release version
13+
PREVIOUS_TAG=$(git describe --tags --abbrev=0 --match='v*' --exclude="$RELEASE_VERSION")
14+
15+
# 2. Generate the changelog with ghch
16+
echo "--- Generating changelog from ${PREVIOUS_TAG} to ${RELEASE_VERSION}"
17+
CHANGELOG_BODY=$(ghch --format=markdown --from="$PREVIOUS_TAG" --next-version="$RELEASE_VERSION")
18+
19+
# 3. Check for Buildkite Agent updates
20+
AGENT_INSTALL_SCRIPT_LINUX="packer/linux/scripts/install-buildkite-agent.sh"
21+
AGENT_INSTALL_SCRIPT_WINDOWS="packer/windows/scripts/install-buildkite-agent.ps1"
22+
23+
if git diff --name-only "$PREVIOUS_TAG..HEAD" -- "$AGENT_INSTALL_SCRIPT_LINUX" "$AGENT_INSTALL_SCRIPT_WINDOWS" | grep -q "."; then
24+
echo "--- Buildkite Agent version has changed. Fetching agent release notes."
25+
AGENT_VERSION=$(grep "AGENT_VERSION=" "$AGENT_INSTALL_SCRIPT_LINUX" | cut -d'=' -f2)
26+
AGENT_RELEASE_NOTES=$(gh release view "v${AGENT_VERSION}" --repo "buildkite/agent" --json body -q .body)
27+
AGENT_CHANGELOG_DETAILS="<details>\n <summary><h3>Agent Changelog</h3></summary>\n\n${AGENT_RELEASE_NOTES}\n</details>"
28+
CHANGELOG_BODY+="\n\n${AGENT_CHANGELOG_DETAILS}"
29+
fi
30+
31+
# 4. Update CHANGELOG.md, preserving the header
32+
echo "--- Updating CHANGELOG.md"
33+
CHANGELOG_HEADER=$(head -n 5 CHANGELOG.md)
34+
CHANGELOG_REST=$(tail -n +6 CHANGELOG.md)
35+
36+
# Construct the new file content
37+
NEW_CHANGELOG_CONTENT="${CHANGELOG_HEADER}\n\n${CHANGELOG_BODY}\n\n${CHANGELOG_REST}"
38+
39+
echo -e "$NEW_CHANGELOG_CONTENT" >CHANGELOG.md
40+
41+
echo "CHANGELOG.md has been updated for ${RELEASE_VERSION}. Please review and create a pull request."

.buildkite/steps/cfn-lint.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
echo "--- Installing cfn-lint"
5+
pip install -q cfn-lint==1.36.0
6+
7+
echo "--- Running cfn-lint on templates in templates/"
8+
# cfn-lint will scan all *.json, *.yaml, *.yml, *.template files in the directory and subdirectories.
9+
/var/lib/buildkite-agent/.local/bin/cfn-lint templates/*

0 commit comments

Comments
 (0)