pull/310/head
Frostebite 2021-12-30 03:01:38 +00:00
parent 2b82bcf4b1
commit 60301c78f1
6 changed files with 17 additions and 22 deletions

18
dist/index.js vendored
View File

@ -390,7 +390,7 @@ class CLI {
return __awaiter(this, void 0, void 0, function* () {
core.info(`Entrypoint: ${options.mode}`);
if (options.mode === 'remote-cli') {
yield remote_client_1.RemoteClient.Run(options);
yield remote_client_1.RemoteClient.Run();
}
else {
options.versioning = 'None';
@ -707,15 +707,11 @@ exports.RemoteClient = void 0;
const cloud_runner_state_1 = __webpack_require__(70912);
const cloud_runner_repository_setup_1 = __webpack_require__(21811);
class RemoteClient {
static Run(options) {
static Run() {
return __awaiter(this, void 0, void 0, function* () {
const buildParameter = JSON.parse(process.env.buildParameters || '{}');
cloud_runner_state_1.CloudRunnerState.setup(buildParameter);
switch (options.remoteClientState) {
default:
yield cloud_runner_repository_setup_1.CloudRunnerRepositorySetup.run();
break;
}
yield cloud_runner_repository_setup_1.CloudRunnerRepositorySetup.run();
});
}
}
@ -968,7 +964,7 @@ class AWSError {
core.error(JSON.stringify(error, undefined, 4));
cloud_runner_logger_1.default.log('Getting events and resources for task stack');
const events = (_a = (yield CF.describeStackEvents({ StackName: taskDefStackName }).promise()).StackEvents) === null || _a === void 0 ? void 0 : _a.filter((x) => {
x.ResourceStatus === `CREATE_FAILED`;
x.ResourceStatus !== `DELETE_COMPLETE` && x.ResourceStatus !== `CREATE_COMPLETE`;
});
cloud_runner_logger_1.default.log(JSON.stringify(events, undefined, 4));
});
@ -2359,9 +2355,11 @@ class KubernetesTaskRunner {
let success = false;
cloud_runner_logger_1.default.log(`Watching ${podName} ${namespace}`);
yield async_wait_until_1.default(() => __awaiter(this, void 0, void 0, function* () {
var _a, _b;
const phase = (_b = (_a = (yield kubeClient.readNamespacedPodStatus(podName, namespace))) === null || _a === void 0 ? void 0 : _a.body.status) === null || _b === void 0 ? void 0 : _b.phase;
var _a;
const status = yield kubeClient.readNamespacedPodStatus(podName, namespace);
const phase = (_a = status === null || status === void 0 ? void 0 : status.body.status) === null || _a === void 0 ? void 0 : _a.phase;
success = phase === 'Running';
cloud_runner_logger_1.default.log(`${JSON.stringify(status.body.status, undefined, 4)}`);
if (success || phase !== 'Pending')
return true;
return false;

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -3,13 +3,12 @@ import { BuildParameters, CloudRunner, ImageTag, Input } from '..';
import * as core from '@actions/core';
import { RemoteClient } from './remote-client';
import { ActionYamlReader } from '../input-readers/action-yaml';
export class CLI {
static async RunCli(options: any) {
static async RunCli(options: any): Promise<void> {
core.info(`Entrypoint: ${options.mode}`);
if (options.mode === 'remote-cli') {
await RemoteClient.Run(options);
await RemoteClient.Run();
} else {
options.versioning = 'None';
Input.cliOptions = options;

View File

@ -2,13 +2,9 @@ import { CloudRunnerState } from '../../cloud-runner/state/cloud-runner-state';
import { CloudRunnerRepositorySetup } from './cloud-runner-repository-setup';
export class RemoteClient {
static async Run(options) {
static async Run() {
const buildParameter = JSON.parse(process.env.buildParameters || '{}');
CloudRunnerState.setup(buildParameter);
switch (options.remoteClientState) {
default:
await CloudRunnerRepositorySetup.run();
break;
}
await CloudRunnerRepositorySetup.run();
}
}

View File

@ -9,7 +9,7 @@ export class AWSError {
CloudRunnerLogger.log('Getting events and resources for task stack');
const events = (await CF.describeStackEvents({ StackName: taskDefStackName }).promise()).StackEvents?.filter(
(x) => {
x.ResourceStatus === `CREATE_FAILED`;
x.ResourceStatus !== `DELETE_COMPLETE` && x.ResourceStatus !== `CREATE_COMPLETE`;
},
);
CloudRunnerLogger.log(JSON.stringify(events, undefined, 4));

View File

@ -76,8 +76,10 @@ class KubernetesTaskRunner {
CloudRunnerLogger.log(`Watching ${podName} ${namespace}`);
await waitUntil(
async () => {
const phase = (await kubeClient.readNamespacedPodStatus(podName, namespace))?.body.status?.phase;
const status = await kubeClient.readNamespacedPodStatus(podName, namespace);
const phase = status?.body.status?.phase;
success = phase === 'Running';
CloudRunnerLogger.log(`${JSON.stringify(status.body.status, undefined, 4)}`);
if (success || phase !== 'Pending') return true;
return false;
},