Skip to content

Commit b84d760

Browse files
author
James Healy
authored
Merge pull request #796 from buildkite/ci-fix-cleanup
CI: fix cleanup process
2 parents 9031947 + 6f94605 commit b84d760

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

.buildkite/steps/cleanup.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ delete_test_stack() {
2525
}
2626

2727
if [[ -n "${BUILDKITE_BUILD_NUMBER:-}" ]] ; then
28-
delete_test_stack "windows"
29-
delete_test_stack "linux"
28+
delete_test_stack "windows-amd64"
29+
delete_test_stack "linux-amd64"
30+
delete_test_stack "linux-arm64"
3031
fi
3132

3233
if [[ $OSTYPE =~ ^darwin ]] ; then
@@ -44,15 +45,15 @@ aws s3api list-buckets \
4445
--output text \
4546
--query "$(printf 'Buckets[?CreationDate<`%s`].[Name]' "$cutoff_date" )" \
4647
| xargs -n1 \
47-
| grep -E 'buildkite-aws-stack-test-(\d+-)?managedsecrets' \
48+
| grep -E 'buildkite-aws-stack-test-.*-managedsecretsbucket' \
4849
| xargs -n1 -t -I% aws s3 rb s3://% --force
4950

5051
echo "--- Deleting old cloudformation stacks"
5152
aws cloudformation describe-stacks \
5253
--output text \
5354
--query "$(printf 'Stacks[?CreationTime<`%s`].[StackName]' "$cutoff_date" )" \
5455
| xargs -n1 \
55-
| grep -E 'buildkite-aws-stack-test-\d+' \
56+
| grep -E 'buildkite-aws-stack-test-(linux|windows)-(amd64|arm64)-[[:digit:]]+' \
5657
| xargs -n1 -t -I% aws cloudformation delete-stack --stack-name "%"
5758

5859
echo "--- Deleting old packer builders"

0 commit comments

Comments
 (0)