new lines between methods

pull/310/head
Frostebite 2021-12-29 15:33:07 +00:00
parent 4125ce11b0
commit a67902498b
6 changed files with 29 additions and 39 deletions

21
dist/index.js vendored
View File

@ -414,7 +414,6 @@ class CLI {
core.info(`\n`);
core.info(`INPUT:`);
for (const element of properties) {
// TODO pull description from action.yml
program.option(`--${element} <${element}>`, action_yaml_1.ActionYamlReader.Instance.GetActionYamlValue(element));
if (__1.Input[element] !== undefined && __1.Input[element] !== '') {
core.info(`${element} ${__1.Input[element]}`);
@ -2289,7 +2288,6 @@ class KubernetesStorage {
}
catch (error) {
core.error('Failed to watch PVC');
core.error(error);
core.error(JSON.stringify(error, undefined, 4));
core.error(`PVC Body: ${JSON.stringify((yield kubeClient.readNamespacedPersistentVolumeClaim(name, namespace)).body, undefined, 4)}`);
throw error;
@ -2320,13 +2318,7 @@ class KubernetesStorage {
static handleResult(result, kubeClient, namespace, pvcName) {
var _a;
return __awaiter(this, void 0, void 0, function* () {
const name = (_a = result.body.metadata) === null || _a === void 0 ? void 0 : _a.name;
if (!name)
throw new Error('failed to create PVC');
// don't always log the PVC...
// CloudRunnerLogger.log(
// JSON.stringify(await kubeClient.readNamespacedPersistentVolumeClaim(name, namespace), undefined, 4),
// );
const name = ((_a = result.body.metadata) === null || _a === void 0 ? void 0 : _a.name) || '';
cloud_runner_logger_1.default.log(`PVC ${name} created`);
yield this.watchUntilPVCNotPending(kubeClient, name, namespace);
cloud_runner_logger_1.default.log(`PVC ${name} is ready and not pending`);
@ -2362,7 +2354,8 @@ const cloud_runner_logger_1 = __importDefault(__webpack_require__(22855));
class KubernetesUtilities {
static findPodFromJob(kubeClient, jobName, namespace) {
return __awaiter(this, void 0, void 0, function* () {
const pod = (yield kubeClient.listNamespacedPod(namespace)).body.items.find((x) => { var _a, _b; return ((_b = (_a = x.metadata) === null || _a === void 0 ? void 0 : _a.labels) === null || _b === void 0 ? void 0 : _b['job-name']) === jobName; });
const newLocal = yield kubeClient.listNamespacedPod(namespace);
const pod = (newLocal).body.items.find((x) => { var _a, _b; return ((_b = (_a = x.metadata) === null || _a === void 0 ? void 0 : _a.labels) === null || _b === void 0 ? void 0 : _b['job-name']) === jobName; });
if (pod === undefined) {
throw new Error("pod with job-name label doesn't exist");
}
@ -2579,12 +2572,6 @@ class CloudRunnerState {
}
}
exports.CloudRunnerState = CloudRunnerState;
CloudRunnerState.defaultGitShaEnvironmentVariable = [
{
name: 'GITHUB_SHA',
value: process.env.GITHUB_SHA || '',
},
];
CloudRunnerState.repositoryFolder = 'repo';
@ -3482,7 +3469,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.GithubCliReader = void 0;
class GithubCliReader {
static GetGitHubAuthToken() {
// TODO Get from git auth status -t
// `gh auth status -t`
return '';
}
}

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -35,7 +35,6 @@ export class CLI {
core.info(`\n`);
core.info(`INPUT:`);
for (const element of properties) {
// TODO pull description from action.yml
program.option(`--${element} <${element}>`, ActionYamlReader.Instance.GetActionYamlValue(element));
if (Input[element] !== undefined && Input[element] !== '') {
core.info(`${element} ${Input[element]}`);

View File

@ -56,7 +56,6 @@ class KubernetesStorage {
);
} catch (error) {
core.error('Failed to watch PVC');
core.error(error);
core.error(JSON.stringify(error, undefined, 4));
core.error(
`PVC Body: ${JSON.stringify(
@ -100,12 +99,7 @@ class KubernetesStorage {
namespace: string,
pvcName: string,
) {
const name = result.body.metadata?.name;
if (!name) throw new Error('failed to create PVC');
// don't always log the PVC...
// CloudRunnerLogger.log(
// JSON.stringify(await kubeClient.readNamespacedPersistentVolumeClaim(name, namespace), undefined, 4),
// );
const name = result.body.metadata?.name || '';
CloudRunnerLogger.log(`PVC ${name} created`);
await this.watchUntilPVCNotPending(kubeClient, name, namespace);
CloudRunnerLogger.log(`PVC ${name} is ready and not pending`);

View File

@ -7,6 +7,12 @@ import CloudRunnerSecret from '../services/cloud-runner-secret';
import { TaskParameterSerializer } from './task-parameter-serializer';
export class CloudRunnerState {
public static CloudRunnerProviderPlatform: CloudRunnerProviderInterface;
public static buildParams: BuildParameters;
public static defaultSecrets: CloudRunnerSecret[];
public static buildGuid: string;
public static readonly repositoryFolder = 'repo';
static setup(buildParameters: BuildParameters) {
CloudRunnerState.buildParams = buildParameters;
if (CloudRunnerState.buildGuid === undefined) {
@ -17,49 +23,59 @@ export class CloudRunnerState {
}
TaskParameterSerializer.setupDefaultSecrets();
}
public static CloudRunnerProviderPlatform: CloudRunnerProviderInterface;
public static buildParams: BuildParameters;
public static defaultSecrets: CloudRunnerSecret[];
public static buildGuid: string;
public static get branchName(): string {
return CloudRunnerState.buildParams.branch;
}
public static get buildPathFull(): string {
return path.join(`/`, CloudRunnerState.buildVolumeFolder, CloudRunnerState.buildGuid);
}
public static get builderPathFull(): string {
return path.join(CloudRunnerState.buildPathFull, `builder`);
}
public static get steamPathFull(): string {
return path.join(CloudRunnerState.buildPathFull, `steam`);
}
public static get repoPathFull(): string {
return path.join(CloudRunnerState.buildPathFull, CloudRunnerState.repositoryFolder);
}
public static get projectPathFull(): string {
return path.join(CloudRunnerState.repoPathFull, CloudRunnerState.buildParams.projectPath);
}
public static get libraryFolderFull(): string {
return path.join(CloudRunnerState.projectPathFull, `Library`);
}
public static get cacheFolderFull(): string {
return path.join(CloudRunnerState.buildVolumeFolder, CloudRunnerState.cacheFolder, CloudRunnerState.branchName);
}
public static get lfsDirectory(): string {
return path.join(CloudRunnerState.repoPathFull, `.git`, `lfs`);
}
public static get purgeRemoteCaching(): boolean {
return process.env.PURGE_REMOTE_BUILDER_CACHE !== undefined;
}
public static get lfsCacheFolder() {
return path.join(CloudRunnerState.cacheFolderFull, `lfs`);
}
public static get libraryCacheFolder() {
return path.join(CloudRunnerState.cacheFolderFull, `lib`);
}
public static get unityBuilderRepoUrl(): string {
return `https://${CloudRunnerState.buildParams.githubToken}@github.com/game-ci/unity-builder.git`;
}
public static get targetBuildRepoUrl(): string {
return `https://${CloudRunnerState.buildParams.githubToken}@github.com/${CloudRunnerState.githubRepo}.git`;
}
@ -67,20 +83,14 @@ export class CloudRunnerState {
public static get githubRepo(): string {
return `${CloudRunnerState.buildParams.githubRepo}`;
}
public static readonly defaultGitShaEnvironmentVariable = [
{
name: 'GITHUB_SHA',
value: process.env.GITHUB_SHA || '',
},
];
public static readonly repositoryFolder = 'repo';
public static get buildVolumeFolder() {
return path.join('/', 'data');
}
public static get cacheFolder() {
return 'cache';
}
public static cloudRunnerBranch: string;
public static readBuildEnvironmentVariables(): CloudRunnerEnvironmentVariable[] {
return TaskParameterSerializer.readBuildEnvironmentVariables();

View File

@ -1,6 +1,6 @@
export class GithubCliReader {
static GetGitHubAuthToken() {
// TODO Get from git auth status -t
// `gh auth status -t`
return '';
}
}