fixed delete command for testservers

This commit is contained in:
Arwid Thornström
2026-03-04 14:03:44 +01:00
parent e78ffc1a40
commit 11bd5ca3a3
@@ -67,6 +67,7 @@ module.exports = {
});
const stackName = await prompt.run();
const stackNumber = stackName.replace('photowall-test-', '');
const shouldRun = await getConfirmation(stackName);
@@ -94,10 +95,31 @@ module.exports = {
)
.split('\n');
for (const artifact of artifacts) {
if (artifact && artifact.length > 0) {
await runCommand(
system,
await confirmCommand(`aws s3 rb --force s3://${artifact}`),
);
} else {
toolbox.print.info(`No artifact bucket found for ${stackName}`);
}
}
const distBuckets = strings
.trim(
await system.run(
`aws s3 ls | grep test-${stackNumber}-dist | awk '{print $3}'`,
),
)
.split('\n');
for (const distBucket of distBuckets) {
if (distBucket && distBucket.length > 0) {
await runCommand(
system,
await confirmCommand(`aws s3 rb --force s3://${distBucket}`),
);
} else {
toolbox.print.info(`No dist bucket found for ${stackName}`);
}
}
await runCommand(
system,