Fix: read git branch from project path git repo
parent
47a13c3787
commit
8ca1e9012b
|
|
@ -712,6 +712,9 @@ class CloudRunnerOptions {
|
|||
static get cloudRunnerTests() {
|
||||
return CloudRunnerOptions.getInput(`cloudRunnerTests`) || false;
|
||||
}
|
||||
static get watchCloudRunnerToEnd() {
|
||||
return CloudRunnerOptions.getInput(`watchCloudRunnerToEnd`) !== 'false' || true;
|
||||
}
|
||||
static ToEnvVarFormat(input) {
|
||||
if (input.toUpperCase() === input) {
|
||||
return input;
|
||||
|
|
@ -1362,6 +1365,7 @@ const __1 = __nccwpck_require__(41359);
|
|||
const cloud_runner_1 = __importDefault(__nccwpck_require__(79144));
|
||||
const cloud_runner_custom_hooks_1 = __nccwpck_require__(58873);
|
||||
const follow_log_stream_service_1 = __nccwpck_require__(64121);
|
||||
const cloud_runner_options_1 = __importDefault(__nccwpck_require__(96552));
|
||||
class AWSTaskRunner {
|
||||
static runTask(taskDef, environment, commands) {
|
||||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
||||
|
|
@ -1398,6 +1402,11 @@ class AWSTaskRunner {
|
|||
cloud_runner_logger_1.default.log('Cloud runner job is starting');
|
||||
yield AWSTaskRunner.waitUntilTaskRunning(taskArn, cluster);
|
||||
cloud_runner_logger_1.default.log(`Cloud runner job status is running ${(_p = (yield AWSTaskRunner.describeTasks(cluster, taskArn))) === null || _p === void 0 ? void 0 : _p.lastStatus}`);
|
||||
if (cloud_runner_options_1.default.watchCloudRunnerToEnd) {
|
||||
const shouldCleanup = false;
|
||||
const output = '';
|
||||
return { output, shouldCleanup };
|
||||
}
|
||||
const { output, shouldCleanup } = yield this.streamLogsUntilTaskStops(cluster, taskArn, streamName);
|
||||
const taskData = yield AWSTaskRunner.describeTasks(cluster, taskArn);
|
||||
const exitCode = (_q = taskData.containers) === null || _q === void 0 ? void 0 : _q[0].exitCode;
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -157,6 +157,10 @@ class CloudRunnerOptions {
|
|||
return CloudRunnerOptions.getInput(`cloudRunnerTests`) || false;
|
||||
}
|
||||
|
||||
static get watchCloudRunnerToEnd(): boolean {
|
||||
return CloudRunnerOptions.getInput(`watchCloudRunnerToEnd`) !== 'false' || true;
|
||||
}
|
||||
|
||||
public static ToEnvVarFormat(input: string) {
|
||||
if (input.toUpperCase() === input) {
|
||||
return input;
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import { Input } from '../../..';
|
|||
import CloudRunner from '../../cloud-runner';
|
||||
import { CloudRunnerCustomHooks } from '../../services/cloud-runner-custom-hooks';
|
||||
import { FollowLogStreamService } from '../../services/follow-log-stream-service';
|
||||
import CloudRunnerOptions from '../../cloud-runner-options';
|
||||
|
||||
class AWSTaskRunner {
|
||||
public static ECS: AWS.ECS;
|
||||
|
|
@ -16,7 +17,7 @@ class AWSTaskRunner {
|
|||
taskDef: CloudRunnerAWSTaskDef,
|
||||
environment: CloudRunnerEnvironmentVariable[],
|
||||
commands: string,
|
||||
) {
|
||||
): Promise<{ output: string; shouldCleanup: boolean }> {
|
||||
const cluster = taskDef.baseResources?.find((x) => x.LogicalResourceId === 'ECSCluster')?.PhysicalResourceId || '';
|
||||
const taskDefinition =
|
||||
taskDef.taskDefResources?.find((x) => x.LogicalResourceId === 'TaskDefinition')?.PhysicalResourceId || '';
|
||||
|
|
@ -57,6 +58,12 @@ class AWSTaskRunner {
|
|||
CloudRunnerLogger.log(
|
||||
`Cloud runner job status is running ${(await AWSTaskRunner.describeTasks(cluster, taskArn))?.lastStatus}`,
|
||||
);
|
||||
if (CloudRunnerOptions.watchCloudRunnerToEnd) {
|
||||
const shouldCleanup: boolean = false;
|
||||
const output: string = '';
|
||||
|
||||
return { output, shouldCleanup };
|
||||
}
|
||||
const { output, shouldCleanup } = await this.streamLogsUntilTaskStops(cluster, taskArn, streamName);
|
||||
const taskData = await AWSTaskRunner.describeTasks(cluster, taskArn);
|
||||
const exitCode = taskData.containers?.[0].exitCode;
|
||||
|
|
|
|||
Loading…
Reference in New Issue