fixed delete command for testservers
This commit is contained in:
@@ -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) {
|
||||
await runCommand(
|
||||
system,
|
||||
await confirmCommand(`aws s3 rb --force s3://${artifact}`),
|
||||
);
|
||||
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,
|
||||
|
||||
Reference in New Issue
Block a user