fixed delete command for testservers
This commit is contained in:
@@ -67,6 +67,7 @@ module.exports = {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const stackName = await prompt.run();
|
const stackName = await prompt.run();
|
||||||
|
const stackNumber = stackName.replace('photowall-test-', '');
|
||||||
|
|
||||||
const shouldRun = await getConfirmation(stackName);
|
const shouldRun = await getConfirmation(stackName);
|
||||||
|
|
||||||
@@ -94,10 +95,31 @@ module.exports = {
|
|||||||
)
|
)
|
||||||
.split('\n');
|
.split('\n');
|
||||||
for (const artifact of artifacts) {
|
for (const artifact of artifacts) {
|
||||||
|
if (artifact && artifact.length > 0) {
|
||||||
await runCommand(
|
await runCommand(
|
||||||
system,
|
system,
|
||||||
await confirmCommand(`aws s3 rb --force s3://${artifact}`),
|
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(
|
await runCommand(
|
||||||
system,
|
system,
|
||||||
|
|||||||
Reference in New Issue
Block a user