mirror of
https://github.com/game-ci/unity-builder.git
synced 2026-06-17 05:26:47 -07:00
fixes
This commit is contained in:
+21
-4
@@ -1609,17 +1609,34 @@ class AWSBaseStack {
|
|||||||
Parameters: parameters,
|
Parameters: parameters,
|
||||||
Capabilities: ['CAPABILITY_IAM'],
|
Capabilities: ['CAPABILITY_IAM'],
|
||||||
};
|
};
|
||||||
const stacks = await CF.send(new client_cloudformation_1.ListStacksCommand({ StackStatusFilter: ['UPDATE_COMPLETE', 'CREATE_COMPLETE', 'ROLLBACK_COMPLETE'] }));
|
const stacks = await CF.send(new client_cloudformation_1.ListStacksCommand({
|
||||||
|
StackStatusFilter: ['CREATE_IN_PROGRESS', 'UPDATE_IN_PROGRESS', 'UPDATE_COMPLETE', 'CREATE_COMPLETE', 'ROLLBACK_COMPLETE'],
|
||||||
|
}));
|
||||||
const stackNames = stacks.StackSummaries?.map((x) => x.StackName) || [];
|
const stackNames = stacks.StackSummaries?.map((x) => x.StackName) || [];
|
||||||
const stackExists = stackNames.includes(baseStackName) || false;
|
const stackExists = stackNames.includes(baseStackName);
|
||||||
const describeStack = async () => {
|
const describeStack = async () => {
|
||||||
return await CF.send(new client_cloudformation_1.DescribeStacksCommand(describeStackInput));
|
return await CF.send(new client_cloudformation_1.DescribeStacksCommand(describeStackInput));
|
||||||
};
|
};
|
||||||
try {
|
try {
|
||||||
if (!stackExists) {
|
if (!stackExists) {
|
||||||
cloud_runner_logger_1.default.log(`${baseStackName} stack does not exist (${JSON.stringify(stackNames)})`);
|
cloud_runner_logger_1.default.log(`${baseStackName} stack does not exist (${JSON.stringify(stackNames)})`);
|
||||||
await CF.send(new client_cloudformation_1.CreateStackCommand(createStackInput));
|
let created = false;
|
||||||
cloud_runner_logger_1.default.log(`created stack (version: ${parametersHash})`);
|
try {
|
||||||
|
await CF.send(new client_cloudformation_1.CreateStackCommand(createStackInput));
|
||||||
|
created = true;
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
const message = `${error?.name ?? ''} ${error?.message ?? ''}`;
|
||||||
|
if (message.includes('AlreadyExistsException')) {
|
||||||
|
cloud_runner_logger_1.default.log(`Base stack already exists, continuing with describe`);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (created) {
|
||||||
|
cloud_runner_logger_1.default.log(`created stack (version: ${parametersHash})`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
const CFState = await describeStack();
|
const CFState = await describeStack();
|
||||||
let stack = CFState.Stacks?.[0];
|
let stack = CFState.Stacks?.[0];
|
||||||
|
|||||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -58,18 +58,33 @@ export class AWSBaseStack {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const stacks = await CF.send(
|
const stacks = await CF.send(
|
||||||
new ListStacksCommand({ StackStatusFilter: ['UPDATE_COMPLETE', 'CREATE_COMPLETE', 'ROLLBACK_COMPLETE'] }),
|
new ListStacksCommand({
|
||||||
|
StackStatusFilter: ['CREATE_IN_PROGRESS', 'UPDATE_IN_PROGRESS', 'UPDATE_COMPLETE', 'CREATE_COMPLETE', 'ROLLBACK_COMPLETE'],
|
||||||
|
}),
|
||||||
);
|
);
|
||||||
const stackNames = stacks.StackSummaries?.map((x) => x.StackName) || [];
|
const stackNames = stacks.StackSummaries?.map((x) => x.StackName) || [];
|
||||||
const stackExists: Boolean = stackNames.includes(baseStackName) || false;
|
const stackExists: boolean = stackNames.includes(baseStackName);
|
||||||
const describeStack = async () => {
|
const describeStack = async () => {
|
||||||
return await CF.send(new DescribeStacksCommand(describeStackInput));
|
return await CF.send(new DescribeStacksCommand(describeStackInput));
|
||||||
};
|
};
|
||||||
try {
|
try {
|
||||||
if (!stackExists) {
|
if (!stackExists) {
|
||||||
CloudRunnerLogger.log(`${baseStackName} stack does not exist (${JSON.stringify(stackNames)})`);
|
CloudRunnerLogger.log(`${baseStackName} stack does not exist (${JSON.stringify(stackNames)})`);
|
||||||
await CF.send(new CreateStackCommand(createStackInput));
|
let created = false;
|
||||||
CloudRunnerLogger.log(`created stack (version: ${parametersHash})`);
|
try {
|
||||||
|
await CF.send(new CreateStackCommand(createStackInput));
|
||||||
|
created = true;
|
||||||
|
} catch (error: any) {
|
||||||
|
const message = `${error?.name ?? ''} ${error?.message ?? ''}`;
|
||||||
|
if (message.includes('AlreadyExistsException')) {
|
||||||
|
CloudRunnerLogger.log(`Base stack already exists, continuing with describe`);
|
||||||
|
} else {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (created) {
|
||||||
|
CloudRunnerLogger.log(`created stack (version: ${parametersHash})`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
const CFState = await describeStack();
|
const CFState = await describeStack();
|
||||||
let stack = CFState.Stacks?.[0];
|
let stack = CFState.Stacks?.[0];
|
||||||
|
|||||||
Reference in New Issue
Block a user