mirror of
https://github.com/game-ci/unity-builder.git
synced 2026-02-05 00:39:06 +08:00
fixes
This commit is contained in:
41
dist/index.js
generated
vendored
41
dist/index.js
generated
vendored
@@ -1573,16 +1573,51 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.AWSBaseStack = void 0;
|
||||
const cloud_runner_logger_1 = __importDefault(__nccwpck_require__(42864));
|
||||
const cloud_runner_options_1 = __importDefault(__nccwpck_require__(66965));
|
||||
const core = __importStar(__nccwpck_require__(42186));
|
||||
const client_cloudformation_1 = __nccwpck_require__(15650);
|
||||
const base_stack_formation_1 = __nccwpck_require__(29643);
|
||||
const node_crypto_1 = __importDefault(__nccwpck_require__(6005));
|
||||
const LOCALSTACK_ENDPOINT_PATTERN = /localstack|localhost|127\.0\.0\.1/i;
|
||||
const LOCALSTACK_WAIT_TIME_SECONDS = 600;
|
||||
const DEFAULT_STACK_WAIT_TIME_SECONDS = 200;
|
||||
function detectLocalStackEnvironment() {
|
||||
const endpoints = [
|
||||
process.env.AWS_ENDPOINT,
|
||||
process.env.AWS_S3_ENDPOINT,
|
||||
process.env.AWS_CLOUD_FORMATION_ENDPOINT,
|
||||
process.env.AWS_ECS_ENDPOINT,
|
||||
process.env.AWS_KINESIS_ENDPOINT,
|
||||
process.env.AWS_CLOUD_WATCH_LOGS_ENDPOINT,
|
||||
cloud_runner_options_1.default.awsEndpoint,
|
||||
cloud_runner_options_1.default.awsS3Endpoint,
|
||||
cloud_runner_options_1.default.awsCloudFormationEndpoint,
|
||||
cloud_runner_options_1.default.awsEcsEndpoint,
|
||||
cloud_runner_options_1.default.awsKinesisEndpoint,
|
||||
cloud_runner_options_1.default.awsCloudWatchLogsEndpoint,
|
||||
]
|
||||
.filter((endpoint) => endpoint !== undefined && endpoint !== '')
|
||||
.join(' ');
|
||||
return LOCALSTACK_ENDPOINT_PATTERN.test(endpoints);
|
||||
}
|
||||
function determineStackWaitTime(isLocalStack) {
|
||||
const overrideValue = Number(process.env.CLOUD_RUNNER_AWS_STACK_WAIT_TIME ?? '');
|
||||
if (!Number.isNaN(overrideValue) && overrideValue > 0) {
|
||||
return overrideValue;
|
||||
}
|
||||
return isLocalStack ? LOCALSTACK_WAIT_TIME_SECONDS : DEFAULT_STACK_WAIT_TIME_SECONDS;
|
||||
}
|
||||
class AWSBaseStack {
|
||||
constructor(baseStackName) {
|
||||
this.baseStackName = baseStackName;
|
||||
}
|
||||
async setupBaseStack(CF) {
|
||||
const baseStackName = this.baseStackName;
|
||||
const isLocalStack = detectLocalStackEnvironment();
|
||||
const stackWaitTimeSeconds = determineStackWaitTime(isLocalStack);
|
||||
if (isLocalStack) {
|
||||
cloud_runner_logger_1.default.log(`LocalStack endpoints detected; will wait up to ${stackWaitTimeSeconds}s for CloudFormation transitions`);
|
||||
}
|
||||
const baseStack = base_stack_formation_1.BaseStackFormation.formation;
|
||||
// Cloud Formation Input
|
||||
const describeStackInput = {
|
||||
@@ -1645,9 +1680,10 @@ class AWSBaseStack {
|
||||
}
|
||||
const stackVersion = stack.Parameters?.find((x) => x.ParameterKey === 'Version')?.ParameterValue;
|
||||
if (stack.StackStatus === 'CREATE_IN_PROGRESS') {
|
||||
cloud_runner_logger_1.default.log(`Waiting up to ${stackWaitTimeSeconds}s for '${baseStackName}' CloudFormation creation to finish`);
|
||||
await (0, client_cloudformation_1.waitUntilStackCreateComplete)({
|
||||
client: CF,
|
||||
maxWaitTime: 200,
|
||||
maxWaitTime: stackWaitTimeSeconds,
|
||||
}, describeStackInput);
|
||||
}
|
||||
if (stackExists) {
|
||||
@@ -1676,9 +1712,10 @@ class AWSBaseStack {
|
||||
throw new Error(`Base stack doesn't exist, even after updating and creation, stackExists check: ${stackExists}`);
|
||||
}
|
||||
if (stack.StackStatus === 'UPDATE_IN_PROGRESS') {
|
||||
cloud_runner_logger_1.default.log(`Waiting up to ${stackWaitTimeSeconds}s for '${baseStackName}' CloudFormation update to finish`);
|
||||
await (0, client_cloudformation_1.waitUntilStackUpdateComplete)({
|
||||
client: CF,
|
||||
maxWaitTime: 200,
|
||||
maxWaitTime: stackWaitTimeSeconds,
|
||||
}, describeStackInput);
|
||||
}
|
||||
}
|
||||
|
||||
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user