correcting bug with async env
parent
e334dc785a
commit
875979c2d7
|
@ -1008,7 +1008,14 @@ const local_1 = __importDefault(__nccwpck_require__(66575));
|
||||||
const docker_1 = __importDefault(__nccwpck_require__(42802));
|
const docker_1 = __importDefault(__nccwpck_require__(42802));
|
||||||
const github_1 = __importDefault(__nccwpck_require__(83654));
|
const github_1 = __importDefault(__nccwpck_require__(83654));
|
||||||
const shared_workspace_locking_1 = __importDefault(__nccwpck_require__(87562));
|
const shared_workspace_locking_1 = __importDefault(__nccwpck_require__(87562));
|
||||||
|
const cloud_runner_options_1 = __importDefault(__nccwpck_require__(96552));
|
||||||
class CloudRunner {
|
class CloudRunner {
|
||||||
|
static get isCloudRunnerEnvironment() {
|
||||||
|
return process.env.cloudRunnerCluster !== undefined && process.env.cloudRunnerCluster !== `local`;
|
||||||
|
}
|
||||||
|
static get isCloudRunnerAsyncEnvironment() {
|
||||||
|
return CloudRunner.isCloudRunnerEnvironment && cloud_runner_options_1.default.asyncCloudRunner;
|
||||||
|
}
|
||||||
static setup(buildParameters) {
|
static setup(buildParameters) {
|
||||||
cloud_runner_logger_1.default.setup();
|
cloud_runner_logger_1.default.setup();
|
||||||
cloud_runner_logger_1.default.log(`Setting up cloud runner`);
|
cloud_runner_logger_1.default.log(`Setting up cloud runner`);
|
||||||
|
@ -6419,7 +6426,7 @@ class GitHub {
|
||||||
}
|
}
|
||||||
static createGitHubCheck(summary) {
|
static createGitHubCheck(summary) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
if (!cloud_runner_options_1.default.githubChecks) {
|
if (!cloud_runner_options_1.default.githubChecks || !cloud_runner_1.default.isCloudRunnerEnvironment) {
|
||||||
return ``;
|
return ``;
|
||||||
}
|
}
|
||||||
GitHub.startedDate = new Date().toISOString();
|
GitHub.startedDate = new Date().toISOString();
|
||||||
|
@ -6484,7 +6491,7 @@ class GitHub {
|
||||||
data.completed_at = GitHub.endedDate || GitHub.startedDate;
|
data.completed_at = GitHub.endedDate || GitHub.startedDate;
|
||||||
data.conclusion = result;
|
data.conclusion = result;
|
||||||
}
|
}
|
||||||
if (yield cloud_runner_options_1.default.asyncCloudRunner) {
|
if (cloud_runner_1.default.isCloudRunnerEnvironment || cloud_runner_1.default.isCloudRunnerAsyncEnvironment) {
|
||||||
yield GitHub.runUpdateAsyncChecksWorkflow(data, `update`);
|
yield GitHub.runUpdateAsyncChecksWorkflow(data, `update`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -242,7 +242,7 @@ class CloudRunnerOptions {
|
||||||
return CloudRunnerOptions.getInput(`watchToEnd`) || true;
|
return CloudRunnerOptions.getInput(`watchToEnd`) || true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static get asyncCloudRunner(): boolean {
|
public static get asyncCloudRunner(): boolean {
|
||||||
return (CloudRunnerOptions.getInput('asyncCloudRunner') || `false`) === `true` || false;
|
return (CloudRunnerOptions.getInput('asyncCloudRunner') || `false`) === `true` || false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@ import LocalCloudRunner from './providers/local';
|
||||||
import LocalDockerCloudRunner from './providers/docker';
|
import LocalDockerCloudRunner from './providers/docker';
|
||||||
import GitHub from '../github';
|
import GitHub from '../github';
|
||||||
import SharedWorkspaceLocking from './services/shared-workspace-locking';
|
import SharedWorkspaceLocking from './services/shared-workspace-locking';
|
||||||
|
import CloudRunnerOptions from './cloud-runner-options';
|
||||||
|
|
||||||
class CloudRunner {
|
class CloudRunner {
|
||||||
public static Provider: ProviderInterface;
|
public static Provider: ProviderInterface;
|
||||||
|
@ -24,6 +25,12 @@ class CloudRunner {
|
||||||
static lockedWorkspace: string | undefined;
|
static lockedWorkspace: string | undefined;
|
||||||
public static readonly retainedWorkspacePrefix: string = `retained-workspace`;
|
public static readonly retainedWorkspacePrefix: string = `retained-workspace`;
|
||||||
public static githubCheckId;
|
public static githubCheckId;
|
||||||
|
public static get isCloudRunnerEnvironment() {
|
||||||
|
return process.env.cloudRunnerCluster !== undefined && process.env.cloudRunnerCluster !== `local`;
|
||||||
|
}
|
||||||
|
public static get isCloudRunnerAsyncEnvironment() {
|
||||||
|
return CloudRunner.isCloudRunnerEnvironment && CloudRunnerOptions.asyncCloudRunner;
|
||||||
|
}
|
||||||
public static setup(buildParameters: BuildParameters) {
|
public static setup(buildParameters: BuildParameters) {
|
||||||
CloudRunnerLogger.setup();
|
CloudRunnerLogger.setup();
|
||||||
CloudRunnerLogger.log(`Setting up cloud runner`);
|
CloudRunnerLogger.log(`Setting up cloud runner`);
|
||||||
|
|
|
@ -44,7 +44,7 @@ class GitHub {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async createGitHubCheck(summary) {
|
public static async createGitHubCheck(summary) {
|
||||||
if (!CloudRunnerOptions.githubChecks) {
|
if (!CloudRunnerOptions.githubChecks || !CloudRunner.isCloudRunnerEnvironment) {
|
||||||
return ``;
|
return ``;
|
||||||
}
|
}
|
||||||
GitHub.startedDate = new Date().toISOString();
|
GitHub.startedDate = new Date().toISOString();
|
||||||
|
@ -114,7 +114,7 @@ class GitHub {
|
||||||
data.conclusion = result;
|
data.conclusion = result;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (await CloudRunnerOptions.asyncCloudRunner) {
|
if (CloudRunner.isCloudRunnerEnvironment || CloudRunner.isCloudRunnerAsyncEnvironment) {
|
||||||
await GitHub.runUpdateAsyncChecksWorkflow(data, `update`);
|
await GitHub.runUpdateAsyncChecksWorkflow(data, `update`);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue