fix base stack exists check
parent
f90c906155
commit
daf987bcd2
|
|
@ -1031,7 +1031,13 @@ class AWSBuildEnvironment {
|
||||||
const describeStackInput = {
|
const describeStackInput = {
|
||||||
StackName: baseStackName,
|
StackName: baseStackName,
|
||||||
};
|
};
|
||||||
let CFState = yield CF.describeStacks(describeStackInput).promise();
|
let CFState;
|
||||||
|
try {
|
||||||
|
CFState = yield CF.describeStacks(describeStackInput).promise();
|
||||||
|
}
|
||||||
|
catch (_g) {
|
||||||
|
CFState = { Stacks: [] };
|
||||||
|
}
|
||||||
const stackExists = CFState.Stacks !== null && CFState.Stacks !== [];
|
const stackExists = CFState.Stacks !== null && CFState.Stacks !== [];
|
||||||
if (stackExists) {
|
if (stackExists) {
|
||||||
yield CF.createStack({
|
yield CF.createStack({
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -237,7 +237,12 @@ class AWSBuildEnvironment implements RemoteBuilderProviderInterface {
|
||||||
const describeStackInput: SDK.CloudFormation.DescribeStacksInput = {
|
const describeStackInput: SDK.CloudFormation.DescribeStacksInput = {
|
||||||
StackName: baseStackName,
|
StackName: baseStackName,
|
||||||
};
|
};
|
||||||
let CFState = await CF.describeStacks(describeStackInput).promise();
|
let CFState;
|
||||||
|
try {
|
||||||
|
CFState = await CF.describeStacks(describeStackInput).promise();
|
||||||
|
} catch {
|
||||||
|
CFState = { Stacks: [] };
|
||||||
|
}
|
||||||
const stackExists: Boolean = CFState.Stacks !== null && CFState.Stacks !== [];
|
const stackExists: Boolean = CFState.Stacks !== null && CFState.Stacks !== [];
|
||||||
if (stackExists) {
|
if (stackExists) {
|
||||||
await CF.createStack({
|
await CF.createStack({
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue