chore: fix imports
parent
8346abff41
commit
bee47ead58
|
|
@ -58,6 +58,8 @@
|
||||||
// For this project only use kebab-case
|
// For this project only use kebab-case
|
||||||
"unicorn/filename-case": ["error", { "cases": { "kebabCase": true } }],
|
"unicorn/filename-case": ["error", { "cases": { "kebabCase": true } }],
|
||||||
// Allow Array.from(set) mitigate TS2569 which would require '--downlevelIteration'
|
// Allow Array.from(set) mitigate TS2569 which would require '--downlevelIteration'
|
||||||
"unicorn/prefer-spread": "off"
|
"unicorn/prefer-spread": "off",
|
||||||
|
// Deno has dependencies file, this rule enforces it's named re-exports
|
||||||
|
"unicorn/prevent-abbreviations": "off"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,28 @@
|
||||||
// These are the packages from Deno that replace the ones from Node.
|
// These are the packages from Deno that replace the ones from Node.
|
||||||
import * as assert from 'https://deno.land/std@0.142.0/testing/mod.ts';
|
import * as assert from 'https://deno.land/std@0.144.0/testing/asserts.ts';
|
||||||
import * as aws from 'https://deno.land/x/aws_sdk@v3.32.0-1/mod.ts';
|
import * as aws from 'https://deno.land/x/aws_api/client/mod.ts';
|
||||||
|
import * as base64 from 'https://deno.land/std@0.145.0/encoding/base64.ts';
|
||||||
import * as compress from 'https://deno.land/x/compress@v0.3.3/mod.ts';
|
import * as compress from 'https://deno.land/x/compress@v0.3.3/mod.ts';
|
||||||
import * as core from 'https://deno.land/x/deno_actions_core/mod.ts';
|
// import * as core from 'https://deno.land/x/deno_actions_core/mod.ts';
|
||||||
import * as fs from 'https://deno.land/std@0.142.0/node/fs/promises.ts';
|
import * as fs from 'https://deno.land/std@0.142.0/node/fs/promises.ts';
|
||||||
import * as fsSync from 'https://deno.land/std@0.142.0/node/fs/mod.ts';
|
import * as fsSync from 'https://deno.land/std@0.142.0/fs/mod.ts';
|
||||||
import * as k8s from 'https://deno.land/x/kubernetes_client/mod.ts';
|
import * as k8s from 'https://deno.land/x/kubernetes_client/mod.ts';
|
||||||
import * as nanoid from 'https://deno.land/x/nanoid/mod.ts';
|
import * as k8sTypes from 'https://deno.land/x/kubernetes_apis/builtin/core@v1/mod.ts';
|
||||||
|
import * as nanoid from 'https://deno.land/x/nanoid@v3.0.0/mod.ts';
|
||||||
import * as path from 'https://deno.land/std@0.142.0/path/mod.ts';
|
import * as path from 'https://deno.land/std@0.142.0/path/mod.ts';
|
||||||
import * as process from 'https://deno.land/std@0.104.0/node/process.ts';
|
import * as process from 'https://deno.land/std@0.104.0/node/process.ts';
|
||||||
import * as semver from 'https://deno.land/x/semver@v1.4.0/mod.ts';
|
import * as semver from 'https://deno.land/x/semver@v1.4.0/mod.ts';
|
||||||
import * as waitUntil from 'async-wait-until';
|
import * as waitUntil from './helpers/waitUntil.ts';
|
||||||
import * as yaml from 'https://deno.land/x/yaml@v2.1.1/mod.ts';
|
import * as yaml from 'https://deno.land/std@0.145.0/encoding/yaml.ts';
|
||||||
import { crypto } from 'https://deno.land/std@0.142.0/crypto/mod.ts';
|
import { crypto } from 'https://deno.land/std@0.142.0/crypto/mod.ts';
|
||||||
import { v4 as uuid } from 'https://deno.land/std@0.142.0/uuid/mod.ts';
|
import { v4 as uuid } from 'https://deno.land/std@0.142.0/uuid/mod.ts';
|
||||||
|
import * as http from 'https://deno.land/std@0.145.0/node/http.ts';
|
||||||
|
|
||||||
|
const core = {
|
||||||
|
setFailed: () => {},
|
||||||
|
info: () => {},
|
||||||
|
error: () => {},
|
||||||
|
};
|
||||||
|
|
||||||
const exec = () => {
|
const exec = () => {
|
||||||
throw new Error('exec is not implemented'); // @actions/exec'
|
throw new Error('exec is not implemented'); // @actions/exec'
|
||||||
|
|
@ -38,14 +47,29 @@ class Writable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class Command {
|
||||||
|
constructor() {
|
||||||
|
throw new Error('Command is not implemented'); // commander-ts
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const __filename = path.fromFileUrl(import.meta.url);
|
const __filename = path.fromFileUrl(import.meta.url);
|
||||||
const __dirname = path.dirname(path.fromFileUrl(import.meta.url));
|
const __dirname = path.dirname(path.fromFileUrl(import.meta.url));
|
||||||
|
|
||||||
|
const { V1EnvVar, V1EnvVarSource, V1SecretKeySelector } = k8s;
|
||||||
|
|
||||||
export {
|
export {
|
||||||
__dirname,
|
__dirname,
|
||||||
__filename,
|
__filename,
|
||||||
|
k8s,
|
||||||
|
k8sTypes,
|
||||||
|
V1EnvVar,
|
||||||
|
V1EnvVarSource,
|
||||||
|
V1SecretKeySelector,
|
||||||
assert,
|
assert,
|
||||||
aws,
|
aws,
|
||||||
|
base64,
|
||||||
|
Command,
|
||||||
compress,
|
compress,
|
||||||
core,
|
core,
|
||||||
crypto,
|
crypto,
|
||||||
|
|
@ -53,7 +77,7 @@ export {
|
||||||
fs,
|
fs,
|
||||||
fsSync,
|
fsSync,
|
||||||
getUnityChangeSet,
|
getUnityChangeSet,
|
||||||
k8s,
|
http,
|
||||||
nanoid,
|
nanoid,
|
||||||
path,
|
path,
|
||||||
process,
|
process,
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { core, process } from './dependencies.ts';
|
import { core, process } from './dependencies.ts';
|
||||||
import { Action, BuildParameters, Cache, CloudRunner, Docker, ImageTag, Output } from './model.ts';
|
import { Action, BuildParameters, Cache, CloudRunner, Docker, ImageTag, Output } from './model/index.ts';
|
||||||
import { Cli } from './model/cli/cli.ts';
|
import { Cli } from './model/cli/cli.ts';
|
||||||
import MacBuilder from './model/mac-builder.ts';
|
import MacBuilder from './model/mac-builder.ts';
|
||||||
import PlatformSetup from './model/platform-setup.ts';
|
import PlatformSetup from './model/platform-setup.ts';
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { core, semver } from '../../dependencies.ts';
|
import { core, semver } from '../dependencies.ts';
|
||||||
|
|
||||||
export default class AndroidVersioning {
|
export default class AndroidVersioning {
|
||||||
static determineVersionCode(version, inputVersionCode) {
|
static determineVersionCode(version, inputVersionCode) {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { customAlphabet } from '../../../node_modules/nanoid';
|
import { nanoid } from '../dependencies.ts';
|
||||||
import AndroidVersioning from './android-versioning.ts';
|
import AndroidVersioning from './android-versioning.ts';
|
||||||
import CloudRunnerConstants from './cloud-runner/services/cloud-runner-constants.ts';
|
import CloudRunnerConstants from './cloud-runner/services/cloud-runner-constants.ts';
|
||||||
import CloudRunnerBuildGuid from './cloud-runner/services/cloud-runner-guid.ts';
|
import CloudRunnerBuildGuid from './cloud-runner/services/cloud-runner-guid.ts';
|
||||||
|
|
@ -133,7 +133,7 @@ class BuildParameters {
|
||||||
isCliMode: Cli.isCliMode,
|
isCliMode: Cli.isCliMode,
|
||||||
awsStackName: Input.awsBaseStackName,
|
awsStackName: Input.awsBaseStackName,
|
||||||
gitSha: Input.gitSha,
|
gitSha: Input.gitSha,
|
||||||
logId: customAlphabet(CloudRunnerConstants.alphabet, 9)(),
|
logId: nanoid.customAlphabet(CloudRunnerConstants.alphabet, 9)(),
|
||||||
buildGuid: CloudRunnerBuildGuid.generateGuid(Input.runNumber, Input.targetPlatform),
|
buildGuid: CloudRunnerBuildGuid.generateGuid(Input.runNumber, Input.targetPlatform),
|
||||||
customJobHooks: Input.customJobHooks(),
|
customJobHooks: Input.customJobHooks(),
|
||||||
cachePullOverrideCommand: Input.cachePullOverrideCommand(),
|
cachePullOverrideCommand: Input.cachePullOverrideCommand(),
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { Command } from '../../../node_modules/commander-ts';
|
import { Command } from '../../dependencies.ts';
|
||||||
import { BuildParameters, CloudRunner, ImageTag, Input } from '../index.ts';
|
import { BuildParameters, CloudRunner, ImageTag, Input } from '../index.ts';
|
||||||
import { core } from '../../dependencies.ts';
|
import { core } from '../../dependencies.ts';
|
||||||
import { ActionYamlReader } from '../input-readers/action-yaml.ts';
|
import { ActionYamlReader } from '../input-readers/action-yaml.ts';
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import CloudRunnerLogger from '../../services/cloud-runner-logger.ts';
|
import CloudRunnerLogger from '../../services/cloud-runner-logger.ts';
|
||||||
import { core, aws } from '../../dependencies.ts';
|
import { core, aws } from '../../../../dependencies.ts';
|
||||||
import CloudRunner from '../../cloud-runner.ts';
|
import CloudRunner from '../../cloud-runner.ts';
|
||||||
|
|
||||||
export class AWSError {
|
export class AWSError {
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,8 @@
|
||||||
import * as AWS from 'aws-sdk';
|
import { aws, core, compress } from '../../../../dependencies.ts';
|
||||||
import CloudRunnerEnvironmentVariable from '../../services/cloud-runner-environment-variable.ts';
|
import CloudRunnerEnvironmentVariable from '../../services/cloud-runner-environment-variable.ts';
|
||||||
import { core, compress } from '../../dependencies.ts';
|
|
||||||
import CloudRunnerAWSTaskDef from './cloud-runner-aws-task-def.ts';
|
import CloudRunnerAWSTaskDef from './cloud-runner-aws-task-def.ts';
|
||||||
import CloudRunnerLogger from '../../services/cloud-runner-logger.ts';
|
import CloudRunnerLogger from '../../services/cloud-runner-logger.ts';
|
||||||
import { Input } from '../../...ts';
|
import { Input } from '../../../index.ts';
|
||||||
import CloudRunner from '../../cloud-runner.ts';
|
import CloudRunner from '../../cloud-runner.ts';
|
||||||
import { CloudRunnerBuildCommandProcessor } from '../../services/cloud-runner-build-command-process.ts';
|
import { CloudRunnerBuildCommandProcessor } from '../../services/cloud-runner-build-command-process.ts';
|
||||||
import { FollowLogStreamService } from '../../services/follow-log-stream-service.ts';
|
import { FollowLogStreamService } from '../../services/follow-log-stream-service.ts';
|
||||||
|
|
@ -11,8 +10,8 @@ import { FollowLogStreamService } from '../../services/follow-log-stream-service
|
||||||
class AWSTaskRunner {
|
class AWSTaskRunner {
|
||||||
static async runTask(
|
static async runTask(
|
||||||
taskDef: CloudRunnerAWSTaskDef,
|
taskDef: CloudRunnerAWSTaskDef,
|
||||||
ECS: AWS.ECS,
|
ECS: aws.ECS,
|
||||||
CF: AWS.CloudFormation,
|
CF: aws.CloudFormation,
|
||||||
environment: CloudRunnerEnvironmentVariable[],
|
environment: CloudRunnerEnvironmentVariable[],
|
||||||
buildGuid: string,
|
buildGuid: string,
|
||||||
commands: string,
|
commands: string,
|
||||||
|
|
@ -84,7 +83,7 @@ class AWSTaskRunner {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static async waitUntilTaskRunning(ECS: AWS.ECS, taskArn: string, cluster: string) {
|
private static async waitUntilTaskRunning(ECS: aws.ECS, taskArn: string, cluster: string) {
|
||||||
try {
|
try {
|
||||||
await ECS.waitFor('tasksRunning', { tasks: [taskArn], cluster }).promise();
|
await ECS.waitFor('tasksRunning', { tasks: [taskArn], cluster }).promise();
|
||||||
} catch (error_) {
|
} catch (error_) {
|
||||||
|
|
@ -101,7 +100,7 @@ class AWSTaskRunner {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static async describeTasks(ECS: AWS.ECS, clusterName: string, taskArn: string) {
|
static async describeTasks(ECS: aws.ECS, clusterName: string, taskArn: string) {
|
||||||
const tasks = await ECS.describeTasks({
|
const tasks = await ECS.describeTasks({
|
||||||
cluster: clusterName,
|
cluster: clusterName,
|
||||||
tasks: [taskArn],
|
tasks: [taskArn],
|
||||||
|
|
@ -114,14 +113,14 @@ class AWSTaskRunner {
|
||||||
}
|
}
|
||||||
|
|
||||||
static async streamLogsUntilTaskStops(
|
static async streamLogsUntilTaskStops(
|
||||||
ECS: AWS.ECS,
|
ECS: aws.ECS,
|
||||||
CF: AWS.CloudFormation,
|
CF: aws.CloudFormation,
|
||||||
taskDef: CloudRunnerAWSTaskDef,
|
taskDef: CloudRunnerAWSTaskDef,
|
||||||
clusterName: string,
|
clusterName: string,
|
||||||
taskArn: string,
|
taskArn: string,
|
||||||
kinesisStreamName: string,
|
kinesisStreamName: string,
|
||||||
) {
|
) {
|
||||||
const kinesis = new AWS.Kinesis();
|
const kinesis = new aws.Kinesis();
|
||||||
const stream = await AWSTaskRunner.getLogStream(kinesis, kinesisStreamName);
|
const stream = await AWSTaskRunner.getLogStream(kinesis, kinesisStreamName);
|
||||||
let iterator = await AWSTaskRunner.getLogIterator(kinesis, stream);
|
let iterator = await AWSTaskRunner.getLogIterator(kinesis, stream);
|
||||||
|
|
||||||
|
|
@ -149,7 +148,7 @@ class AWSTaskRunner {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static async handleLogStreamIteration(
|
private static async handleLogStreamIteration(
|
||||||
kinesis: AWS.Kinesis,
|
kinesis: aws.Kinesis,
|
||||||
iterator: string,
|
iterator: string,
|
||||||
shouldReadLogs: boolean,
|
shouldReadLogs: boolean,
|
||||||
taskDef: CloudRunnerAWSTaskDef,
|
taskDef: CloudRunnerAWSTaskDef,
|
||||||
|
|
@ -174,7 +173,7 @@ class AWSTaskRunner {
|
||||||
return { iterator, shouldReadLogs, output, shouldCleanup };
|
return { iterator, shouldReadLogs, output, shouldCleanup };
|
||||||
}
|
}
|
||||||
|
|
||||||
private static checkStreamingShouldContinue(taskData: AWS.ECS.Task, timestamp: number, shouldReadLogs: boolean) {
|
private static checkStreamingShouldContinue(taskData: aws.ECS.Task, timestamp: number, shouldReadLogs: boolean) {
|
||||||
if (taskData?.lastStatus === 'UNKNOWN') {
|
if (taskData?.lastStatus === 'UNKNOWN') {
|
||||||
CloudRunnerLogger.log('## Cloud runner job unknwon');
|
CloudRunnerLogger.log('## Cloud runner job unknwon');
|
||||||
}
|
}
|
||||||
|
|
@ -223,7 +222,7 @@ class AWSTaskRunner {
|
||||||
return { shouldReadLogs, output, shouldCleanup };
|
return { shouldReadLogs, output, shouldCleanup };
|
||||||
}
|
}
|
||||||
|
|
||||||
private static async getLogStream(kinesis: AWS.Kinesis, kinesisStreamName: string) {
|
private static async getLogStream(kinesis: aws.Kinesis, kinesisStreamName: string) {
|
||||||
return await kinesis
|
return await kinesis
|
||||||
.describeStream({
|
.describeStream({
|
||||||
StreamName: kinesisStreamName,
|
StreamName: kinesisStreamName,
|
||||||
|
|
@ -231,7 +230,7 @@ class AWSTaskRunner {
|
||||||
.promise();
|
.promise();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static async getLogIterator(kinesis: AWS.Kinesis, stream) {
|
private static async getLogIterator(kinesis: aws.Kinesis, stream) {
|
||||||
return (
|
return (
|
||||||
(
|
(
|
||||||
await kinesis
|
await kinesis
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
import * as AWS from 'aws-sdk';
|
import { aws } from '../../../../dependencies.ts';
|
||||||
|
|
||||||
class CloudRunnerAWSTaskDef {
|
class CloudRunnerAWSTaskDef {
|
||||||
public taskDefStackName!: string;
|
public taskDefStackName!: string;
|
||||||
public taskDefCloudFormation!: string;
|
public taskDefCloudFormation!: string;
|
||||||
public taskDefResources: AWS.CloudFormation.StackResources | undefined;
|
public taskDefResources: aws.CloudFormation.StackResources | undefined;
|
||||||
public baseResources: AWS.CloudFormation.StackResources | undefined;
|
public baseResources: aws.CloudFormation.StackResources | undefined;
|
||||||
}
|
}
|
||||||
export default CloudRunnerAWSTaskDef;
|
export default CloudRunnerAWSTaskDef;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import AWS from 'aws-sdk';
|
import { aws } from '../../../../../dependencies.ts';
|
||||||
import { CliFunction } from '../../../../cli/cli-functions-repository.ts';
|
import { CliFunction } from '../../../../cli/cli-functions-repository.ts';
|
||||||
import Input from '../../../../input.ts';
|
import Input from '../../../../input.ts';
|
||||||
import CloudRunnerLogger from '../../../services/cloud-runner-logger.ts';
|
import CloudRunnerLogger from '../../../services/cloud-runner-logger.ts';
|
||||||
|
|
@ -34,7 +34,7 @@ export class AwsCliCommands {
|
||||||
@CliFunction(`aws-list-stacks`, `List stacks`)
|
@CliFunction(`aws-list-stacks`, `List stacks`)
|
||||||
static async awsListStacks(perResultCallback: any = false, verbose: boolean = false) {
|
static async awsListStacks(perResultCallback: any = false, verbose: boolean = false) {
|
||||||
Deno.env.set('AWS_REGION', Input.region);
|
Deno.env.set('AWS_REGION', Input.region);
|
||||||
const CF = new AWS.CloudFormation();
|
const CF = new aws.CloudFormation();
|
||||||
const stacks =
|
const stacks =
|
||||||
(await CF.listStacks().promise()).StackSummaries?.filter(
|
(await CF.listStacks().promise()).StackSummaries?.filter(
|
||||||
(_x) => _x.StackStatus !== 'DELETE_COMPLETE', // &&
|
(_x) => _x.StackStatus !== 'DELETE_COMPLETE', // &&
|
||||||
|
|
@ -72,17 +72,17 @@ export class AwsCliCommands {
|
||||||
@CliFunction(`aws-list-tasks`, `List tasks`)
|
@CliFunction(`aws-list-tasks`, `List tasks`)
|
||||||
static async awsListTasks(perResultCallback: any = false) {
|
static async awsListTasks(perResultCallback: any = false) {
|
||||||
Deno.env.set('AWS_REGION', Input.region);
|
Deno.env.set('AWS_REGION', Input.region);
|
||||||
const ecs = new AWS.ECS();
|
const ecs = new aws.ECS();
|
||||||
const clusters = (await ecs.listClusters().promise()).clusterArns || [];
|
const clusters = (await ecs.listClusters().promise()).clusterArns || [];
|
||||||
CloudRunnerLogger.log(`Clusters ${clusters.length}`);
|
CloudRunnerLogger.log(`Clusters ${clusters.length}`);
|
||||||
for (const element of clusters) {
|
for (const element of clusters) {
|
||||||
const input: AWS.ECS.ListTasksRequest = {
|
const input: aws.ECS.ListTasksRequest = {
|
||||||
cluster: element,
|
cluster: element,
|
||||||
};
|
};
|
||||||
|
|
||||||
const list = (await ecs.listTasks(input).promise()).taskArns || [];
|
const list = (await ecs.listTasks(input).promise()).taskArns || [];
|
||||||
if (list.length > 0) {
|
if (list.length > 0) {
|
||||||
const describeInput: AWS.ECS.DescribeTasksRequest = { tasks: list, cluster: element };
|
const describeInput: aws.ECS.DescribeTasksRequest = { tasks: list, cluster: element };
|
||||||
const describeList = (await ecs.describeTasks(describeInput).promise()).tasks || [];
|
const describeList = (await ecs.describeTasks(describeInput).promise()).tasks || [];
|
||||||
if (describeList === []) {
|
if (describeList === []) {
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -106,8 +106,8 @@ export class AwsCliCommands {
|
||||||
@CliFunction(`aws-list-log-groups`, `List tasks`)
|
@CliFunction(`aws-list-log-groups`, `List tasks`)
|
||||||
static async awsListLogGroups(perResultCallback: any = false, verbose: boolean = false) {
|
static async awsListLogGroups(perResultCallback: any = false, verbose: boolean = false) {
|
||||||
Deno.env.set('AWS_REGION', Input.region);
|
Deno.env.set('AWS_REGION', Input.region);
|
||||||
const ecs = new AWS.CloudWatchLogs();
|
const ecs = new aws.CloudWatchLogs();
|
||||||
let logStreamInput: AWS.CloudWatchLogs.DescribeLogGroupsRequest = {
|
let logStreamInput: aws.CloudWatchLogs.DescribeLogGroupsRequest = {
|
||||||
/* logGroupNamePrefix: 'game-ci' */
|
/* logGroupNamePrefix: 'game-ci' */
|
||||||
};
|
};
|
||||||
let logGroupsDescribe = await ecs.describeLogGroups(logStreamInput).promise();
|
let logGroupsDescribe = await ecs.describeLogGroups(logStreamInput).promise();
|
||||||
|
|
@ -139,9 +139,9 @@ export class AwsCliCommands {
|
||||||
|
|
||||||
private static async cleanup(deleteResources = false, OneDayOlderOnly: boolean = false) {
|
private static async cleanup(deleteResources = false, OneDayOlderOnly: boolean = false) {
|
||||||
Deno.env.set('AWS_REGION', Input.region);
|
Deno.env.set('AWS_REGION', Input.region);
|
||||||
const CF = new AWS.CloudFormation();
|
const CF = new aws.CloudFormation();
|
||||||
const ecs = new AWS.ECS();
|
const ecs = new aws.ECS();
|
||||||
const cwl = new AWS.CloudWatchLogs();
|
const cwl = new aws.CloudWatchLogs();
|
||||||
await AwsCliCommands.awsListStacks(async (element) => {
|
await AwsCliCommands.awsListStacks(async (element) => {
|
||||||
if (deleteResources && (!OneDayOlderOnly || AwsCliCommands.isOlderThan1day(element.CreationTime))) {
|
if (deleteResources && (!OneDayOlderOnly || AwsCliCommands.isOlderThan1day(element.CreationTime))) {
|
||||||
if (element.StackName === 'game-ci' || element.TemplateDescription === 'Game-CI base stack') {
|
if (element.StackName === 'game-ci' || element.TemplateDescription === 'Game-CI base stack') {
|
||||||
|
|
@ -150,7 +150,7 @@ export class AwsCliCommands {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
CloudRunnerLogger.log(`Deleting ${element.logGroupName}`);
|
CloudRunnerLogger.log(`Deleting ${element.logGroupName}`);
|
||||||
const deleteStackInput: AWS.CloudFormation.DeleteStackInput = { StackName: element.StackName };
|
const deleteStackInput: aws.CloudFormation.DeleteStackInput = { StackName: element.StackName };
|
||||||
await CF.deleteStack(deleteStackInput).promise();
|
await CF.deleteStack(deleteStackInput).promise();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import * as SDK from 'aws-sdk';
|
import { aws } from '../../../../dependencies.ts';
|
||||||
import CloudRunnerSecret from '../../services/cloud-runner-secret.ts';
|
import CloudRunnerSecret from '../../services/cloud-runner-secret.ts';
|
||||||
import CloudRunnerEnvironmentVariable from '../../services/cloud-runner-environment-variable.ts';
|
import CloudRunnerEnvironmentVariable from '../../services/cloud-runner-environment-variable.ts';
|
||||||
import CloudRunnerAWSTaskDef from './cloud-runner-aws-task-def.ts';
|
import CloudRunnerAWSTaskDef from './cloud-runner-aws-task-def.ts';
|
||||||
|
|
@ -8,7 +8,7 @@ import BuildParameters from '../../../build-parameters.ts';
|
||||||
import CloudRunnerLogger from '../../services/cloud-runner-logger.ts';
|
import CloudRunnerLogger from '../../services/cloud-runner-logger.ts';
|
||||||
import { AWSJobStack } from './aws-job-stack.ts';
|
import { AWSJobStack } from './aws-job-stack.ts';
|
||||||
import { AWSBaseStack } from './aws-base-stack.ts';
|
import { AWSBaseStack } from './aws-base-stack.ts';
|
||||||
import { Input } from '../../...ts';
|
import { Input } from '../../../index.ts';
|
||||||
|
|
||||||
class AWSBuildEnvironment implements ProviderInterface {
|
class AWSBuildEnvironment implements ProviderInterface {
|
||||||
private baseStackName: string;
|
private baseStackName: string;
|
||||||
|
|
@ -47,8 +47,8 @@ class AWSBuildEnvironment implements ProviderInterface {
|
||||||
secrets: CloudRunnerSecret[],
|
secrets: CloudRunnerSecret[],
|
||||||
): Promise<string> {
|
): Promise<string> {
|
||||||
Deno.env.set('AWS_REGION', Input.region);
|
Deno.env.set('AWS_REGION', Input.region);
|
||||||
const ECS = new SDK.ECS();
|
const ECS = new aws.ECS();
|
||||||
const CF = new SDK.CloudFormation();
|
const CF = new aws.CloudFormation();
|
||||||
CloudRunnerLogger.log(`AWS Region: ${CF.config.region}`);
|
CloudRunnerLogger.log(`AWS Region: ${CF.config.region}`);
|
||||||
const entrypoint = ['/bin/sh'];
|
const entrypoint = ['/bin/sh'];
|
||||||
const startTimeMs = Date.now();
|
const startTimeMs = Date.now();
|
||||||
|
|
@ -86,7 +86,7 @@ class AWSBuildEnvironment implements ProviderInterface {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async cleanupResources(CF: SDK.CloudFormation, taskDef: CloudRunnerAWSTaskDef) {
|
async cleanupResources(CF: aws.CloudFormation, taskDef: CloudRunnerAWSTaskDef) {
|
||||||
CloudRunnerLogger.log('Cleanup starting');
|
CloudRunnerLogger.log('Cleanup starting');
|
||||||
await CF.deleteStack({
|
await CF.deleteStack({
|
||||||
StackName: taskDef.taskDefStackName,
|
StackName: taskDef.taskDefStackName,
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { BuildParameters, Output } from '../../../index.ts';
|
import { BuildParameters, Output } from '../../../index.ts';
|
||||||
import { core, k8s, waitUntil } from '../../dependencies.ts';
|
import { k8sTypes, core, k8s, waitUntil } from '../../../../dependencies.ts';
|
||||||
import { ProviderInterface } from '../provider-interface.ts';
|
import { ProviderInterface } from '../provider-interface.ts';
|
||||||
import CloudRunnerSecret from '../../services/cloud-runner-secret.ts';
|
import CloudRunnerSecret from '../../services/cloud-runner-secret.ts';
|
||||||
import KubernetesStorage from './kubernetes-storage.ts';
|
import KubernetesStorage from './kubernetes-storage.ts';
|
||||||
|
|
@ -12,9 +12,9 @@ import CloudRunnerLogger from '../../services/cloud-runner-logger.ts';
|
||||||
import DependencyOverrideService from '../../services/depdency-override-service.ts';
|
import DependencyOverrideService from '../../services/depdency-override-service.ts';
|
||||||
|
|
||||||
class Kubernetes implements ProviderInterface {
|
class Kubernetes implements ProviderInterface {
|
||||||
private kubeConfig: k8s.KubeConfig;
|
private kubeConfig: k8sTypes.KubeConfig;
|
||||||
private kubeClient: k8s.CoreV1Api;
|
private kubeClient: k8sTypes.CoreV1Api;
|
||||||
private kubeClientBatch: k8s.BatchV1Api;
|
private kubeClientBatch: k8sTypes.BatchV1Api;
|
||||||
private buildGuid: string = '';
|
private buildGuid: string = '';
|
||||||
private buildParameters: BuildParameters;
|
private buildParameters: BuildParameters;
|
||||||
private pvcName: string = '';
|
private pvcName: string = '';
|
||||||
|
|
@ -29,7 +29,7 @@ class Kubernetes implements ProviderInterface {
|
||||||
constructor(buildParameters: BuildParameters) {
|
constructor(buildParameters: BuildParameters) {
|
||||||
this.kubeConfig = new k8s.KubeConfig();
|
this.kubeConfig = new k8s.KubeConfig();
|
||||||
this.kubeConfig.loadFromDefault();
|
this.kubeConfig.loadFromDefault();
|
||||||
this.kubeClient = this.kubeConfig.makeApiClient(k8s.CoreV1Api);
|
this.kubeClient = this.kubeConfig.makeApiClient(k8sTypes.CoreV1Api);
|
||||||
this.kubeClientBatch = this.kubeConfig.makeApiClient(k8s.BatchV1Api);
|
this.kubeClientBatch = this.kubeConfig.makeApiClient(k8s.BatchV1Api);
|
||||||
CloudRunnerLogger.log('Loaded default Kubernetes configuration for this environment');
|
CloudRunnerLogger.log('Loaded default Kubernetes configuration for this environment');
|
||||||
|
|
||||||
|
|
@ -187,7 +187,7 @@ class Kubernetes implements ProviderInterface {
|
||||||
process.exit();
|
process.exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
static async findPodFromJob(kubeClient: k8s.CoreV1Api, jobName: string, namespace: string) {
|
static async findPodFromJob(kubeClient: k8sTypes.CoreV1Api, jobName: string, namespace: string) {
|
||||||
const namespacedPods = await kubeClient.listNamespacedPod(namespace);
|
const namespacedPods = await kubeClient.listNamespacedPod(namespace);
|
||||||
const pod = namespacedPods.body.items.find((x) => x.metadata?.labels?.['job-name'] === jobName);
|
const pod = namespacedPods.body.items.find((x) => x.metadata?.labels?.['job-name'] === jobName);
|
||||||
if (pod === undefined) {
|
if (pod === undefined) {
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
import { V1EnvVar, V1EnvVarSource, V1SecretKeySelector } from '@kubernetes/client-node';
|
import { V1EnvVar, V1EnvVarSource, V1SecretKeySelector } from '../../../../dependencies.ts';
|
||||||
import BuildParameters from '../../../build-parameters.ts';
|
import BuildParameters from '../../../build-parameters.ts';
|
||||||
import { CloudRunnerBuildCommandProcessor } from '../../services/cloud-runner-build-command-process.ts';
|
import { CloudRunnerBuildCommandProcessor } from '../../services/cloud-runner-build-command-process.ts';
|
||||||
import CloudRunnerEnvironmentVariable from '../../services/cloud-runner-environment-variable';
|
import CloudRunnerEnvironmentVariable from '../../services/cloud-runner-environment-variable.ts';
|
||||||
import CloudRunnerSecret from '../../services/cloud-runner-secret';
|
import CloudRunnerSecret from '../../services/cloud-runner-secret.ts';
|
||||||
import CloudRunner from '../../cloud-runner';
|
import CloudRunner from '../../cloud-runner.ts';
|
||||||
|
|
||||||
class KubernetesJobSpecFactory {
|
class KubernetesJobSpecFactory {
|
||||||
static getJobSpec(
|
static getJobSpec(
|
||||||
|
|
@ -114,7 +114,7 @@ class KubernetesJobSpecFactory {
|
||||||
},
|
},
|
||||||
env: [
|
env: [
|
||||||
...environment.map((x) => {
|
...environment.map((x) => {
|
||||||
const environmentVariable = new V1EnvVar();
|
const environmentVariable = new k8s.V1EnvVar();
|
||||||
environmentVariable.name = x.name;
|
environmentVariable.name = x.name;
|
||||||
environmentVariable.value = x.value;
|
environmentVariable.value = x.value;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,12 @@
|
||||||
import { CoreV1Api } from '@kubernetes/client-node';
|
import { k8sTypes, k8s, base64 } from '../../../../dependencies.ts';
|
||||||
import CloudRunnerSecret from '../../services/cloud-runner-secret.ts';
|
import CloudRunnerSecret from '../../services/cloud-runner-secret.ts';
|
||||||
import * as k8s from '@kubernetes/client-node';
|
|
||||||
const base64 = require('base-64');
|
|
||||||
|
|
||||||
class KubernetesSecret {
|
class KubernetesSecret {
|
||||||
static async createSecret(
|
static async createSecret(
|
||||||
secrets: CloudRunnerSecret[],
|
secrets: CloudRunnerSecret[],
|
||||||
secretName: string,
|
secretName: string,
|
||||||
namespace: string,
|
namespace: string,
|
||||||
kubeClient: CoreV1Api,
|
kubeClient: k8sTypes.CoreV1Api,
|
||||||
) {
|
) {
|
||||||
const secret = new k8s.V1Secret();
|
const secret = new k8s.V1Secret();
|
||||||
secret.apiVersion = 'v1';
|
secret.apiVersion = 'v1';
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
import { CoreV1Api } from '@kubernetes/client-node';
|
import { k8s, k8sTypes } from '../../../../dependencies.ts';
|
||||||
import * as k8s from '@kubernetes/client-node';
|
|
||||||
|
|
||||||
class KubernetesServiceAccount {
|
class KubernetesServiceAccount {
|
||||||
static async createServiceAccount(serviceAccountName: string, namespace: string, kubeClient: CoreV1Api) {
|
static async createServiceAccount(serviceAccountName: string, namespace: string, kubeClient: k8sTypes.CoreV1Api) {
|
||||||
const serviceAccount = new k8s.V1ServiceAccount();
|
const serviceAccount = new k8s.V1ServiceAccount();
|
||||||
serviceAccount.apiVersion = 'v1';
|
serviceAccount.apiVersion = 'v1';
|
||||||
serviceAccount.kind = 'ServiceAccount';
|
serviceAccount.kind = 'ServiceAccount';
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,12 @@
|
||||||
import { k8s, core, YAML } from '../../../../dependencies.ts';
|
import { k8sTypes, k8s, core, yaml, waitUntil, http } from '../../../../dependencies.ts';
|
||||||
import waitUntil from 'async-wait-until';
|
|
||||||
import BuildParameters from '../../../build-parameters.ts';
|
import BuildParameters from '../../../build-parameters.ts';
|
||||||
import CloudRunnerLogger from '../../services/cloud-runner-logger.ts';
|
import CloudRunnerLogger from '../../services/cloud-runner-logger.ts';
|
||||||
import { IncomingMessage } from '../../../node_modules/http';
|
|
||||||
|
|
||||||
class KubernetesStorage {
|
class KubernetesStorage {
|
||||||
public static async createPersistentVolumeClaim(
|
public static async createPersistentVolumeClaim(
|
||||||
buildParameters: BuildParameters,
|
buildParameters: BuildParameters,
|
||||||
pvcName: string,
|
pvcName: string,
|
||||||
kubeClient: k8s.CoreV1Api,
|
kubeClient: k8sTypes.CoreV1Api,
|
||||||
namespace: string,
|
namespace: string,
|
||||||
) {
|
) {
|
||||||
if (buildParameters.kubeVolume) {
|
if (buildParameters.kubeVolume) {
|
||||||
|
|
@ -35,7 +33,7 @@ class KubernetesStorage {
|
||||||
await KubernetesStorage.handleResult(result, kubeClient, namespace, pvcName);
|
await KubernetesStorage.handleResult(result, kubeClient, namespace, pvcName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async getPVCPhase(kubeClient: k8s.CoreV1Api, name: string, namespace: string) {
|
public static async getPVCPhase(kubeClient: k8sTypes.CoreV1Api, name: string, namespace: string) {
|
||||||
try {
|
try {
|
||||||
return (await kubeClient.readNamespacedPersistentVolumeClaim(name, namespace)).body.status?.phase;
|
return (await kubeClient.readNamespacedPersistentVolumeClaim(name, namespace)).body.status?.phase;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
@ -45,7 +43,7 @@ class KubernetesStorage {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async watchUntilPVCNotPending(kubeClient: k8s.CoreV1Api, name: string, namespace: string) {
|
public static async watchUntilPVCNotPending(kubeClient: k8sTypes.CoreV1Api, name: string, namespace: string) {
|
||||||
try {
|
try {
|
||||||
CloudRunnerLogger.log(`watch Until PVC Not Pending ${name} ${namespace}`);
|
CloudRunnerLogger.log(`watch Until PVC Not Pending ${name} ${namespace}`);
|
||||||
CloudRunnerLogger.log(`${await this.getPVCPhase(kubeClient, name, namespace)}`);
|
CloudRunnerLogger.log(`${await this.getPVCPhase(kubeClient, name, namespace)}`);
|
||||||
|
|
@ -75,7 +73,7 @@ class KubernetesStorage {
|
||||||
private static async createPVC(
|
private static async createPVC(
|
||||||
pvcName: string,
|
pvcName: string,
|
||||||
buildParameters: BuildParameters,
|
buildParameters: BuildParameters,
|
||||||
kubeClient: k8s.CoreV1Api,
|
kubeClient: k8sTypes.CoreV1Api,
|
||||||
namespace: string,
|
namespace: string,
|
||||||
) {
|
) {
|
||||||
const pvc = new k8s.V1PersistentVolumeClaim();
|
const pvc = new k8s.V1PersistentVolumeClaim();
|
||||||
|
|
@ -94,7 +92,7 @@ class KubernetesStorage {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
if (Deno.env.get('K8s_STORAGE_PVC_SPEC')) {
|
if (Deno.env.get('K8s_STORAGE_PVC_SPEC')) {
|
||||||
YAML.parse(Deno.env.get('K8s_STORAGE_PVC_SPEC'));
|
yaml.parse(Deno.env.get('K8s_STORAGE_PVC_SPEC'));
|
||||||
}
|
}
|
||||||
const result = await kubeClient.createNamespacedPersistentVolumeClaim(namespace, pvc);
|
const result = await kubeClient.createNamespacedPersistentVolumeClaim(namespace, pvc);
|
||||||
|
|
||||||
|
|
@ -102,8 +100,8 @@ class KubernetesStorage {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static async handleResult(
|
private static async handleResult(
|
||||||
result: { response: IncomingMessage; body: k8s.V1PersistentVolumeClaim },
|
result: { response: http.IncomingMessage; body: k8s.V1PersistentVolumeClaim },
|
||||||
kubeClient: k8s.CoreV1Api,
|
kubeClient: k8sTypes.CoreV1Api,
|
||||||
namespace: string,
|
namespace: string,
|
||||||
pvcName: string,
|
pvcName: string,
|
||||||
) {
|
) {
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,12 @@
|
||||||
import { CoreV1Api, KubeConfig, Log } from '@kubernetes/client-node';
|
|
||||||
import CloudRunnerLogger from '../../services/cloud-runner-logger.ts';
|
import CloudRunnerLogger from '../../services/cloud-runner-logger.ts';
|
||||||
import { core, Writable, waitUntil } from '../../../../dependencies.ts';
|
import { k8sTypes, k8s, core, Writable, waitUntil } from '../../../../dependencies.ts';
|
||||||
import { CloudRunnerStatics } from '../../cloud-runner-statics.ts';
|
import { CloudRunnerStatics } from '../../cloud-runner-statics.ts';
|
||||||
import { FollowLogStreamService } from '../../services/follow-log-stream-service.ts';
|
import { FollowLogStreamService } from '../../services/follow-log-stream-service.ts';
|
||||||
|
|
||||||
class KubernetesTaskRunner {
|
class KubernetesTaskRunner {
|
||||||
static async runTask(
|
static async runTask(
|
||||||
kubeConfig: KubeConfig,
|
kubeConfig: k8sTypes.KubeConfig,
|
||||||
kubeClient: CoreV1Api,
|
kubeClient: k8sTypes.CoreV1Api,
|
||||||
jobName: string,
|
jobName: string,
|
||||||
podName: string,
|
podName: string,
|
||||||
containerName: string,
|
containerName: string,
|
||||||
|
|
@ -38,7 +37,7 @@ class KubernetesTaskRunner {
|
||||||
};
|
};
|
||||||
try {
|
try {
|
||||||
const resultError = await new Promise((resolve) =>
|
const resultError = await new Promise((resolve) =>
|
||||||
new Log(kubeConfig).log(namespace, podName, containerName, stream, resolve, logOptions),
|
new k8s.Log(kubeConfig).log(namespace, podName, containerName, stream, resolve, logOptions),
|
||||||
);
|
);
|
||||||
stream.destroy();
|
stream.destroy();
|
||||||
if (resultError) {
|
if (resultError) {
|
||||||
|
|
@ -78,7 +77,7 @@ class KubernetesTaskRunner {
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
static async watchUntilPodRunning(kubeClient: CoreV1Api, podName: string, namespace: string) {
|
static async watchUntilPodRunning(kubeClient: k8sTypes.CoreV1Api, podName: string, namespace: string) {
|
||||||
let success: boolean = false;
|
let success: boolean = false;
|
||||||
CloudRunnerLogger.log(`Watching ${podName} ${namespace}`);
|
CloudRunnerLogger.log(`Watching ${podName} ${namespace}`);
|
||||||
await waitUntil(
|
await waitUntil(
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { BuildParameters } from '../../index.ts';
|
import { BuildParameters } from '../../index.ts';
|
||||||
import YAML from '../../../../node_modules/yaml';
|
import { yaml } from '../../../dependencies.ts';
|
||||||
import CloudRunnerSecret from './cloud-runner-secret.ts';
|
import CloudRunnerSecret from './cloud-runner-secret.ts';
|
||||||
import CloudRunner from '../cloud-runner.ts';
|
import CloudRunner from '../cloud-runner.ts';
|
||||||
|
|
||||||
|
|
@ -25,7 +25,7 @@ export class CloudRunnerBuildCommandProcessor {
|
||||||
let output = new Array<Hook>();
|
let output = new Array<Hook>();
|
||||||
if (experimentHooks && experimentHooks !== '') {
|
if (experimentHooks && experimentHooks !== '') {
|
||||||
try {
|
try {
|
||||||
output = YAML.parse(experimentHooks);
|
output = yaml.parse(experimentHooks);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import * as path from 'https://deno.land/std@0.141.0/path/mod.ts';
|
import { path } from '../../../dependencies.ts';
|
||||||
import { CloudRunner } from '../...ts';
|
import { CloudRunner } from '../../index.ts';
|
||||||
|
|
||||||
export class CloudRunnerFolders {
|
export class CloudRunnerFolders {
|
||||||
public static readonly repositoryFolder = 'repo';
|
public static readonly repositoryFolder = 'repo';
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { core } from '../../dependencies.ts';
|
import { core } from '../../../dependencies.ts';
|
||||||
|
|
||||||
class CloudRunnerLogger {
|
class CloudRunnerLogger {
|
||||||
private static timestamp: number;
|
private static timestamp: number;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { exec } from '../../../../node_modules/child_process';
|
import { exec } from '../../../dependencies.ts';
|
||||||
import { RemoteClientLogger } from '../remote-client/remote-client-logger.ts';
|
import { RemoteClientLogger } from '../remote-client/remote-client-logger.ts';
|
||||||
|
|
||||||
export class CloudRunnerSystem {
|
export class CloudRunnerSystem {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import CloudRunnerLogger from './cloud-runner-logger.ts';
|
import CloudRunnerLogger from './cloud-runner-logger.ts';
|
||||||
import { core } from '../../dependencies.ts';
|
import { core } from '../../../dependencies.ts';
|
||||||
import CloudRunner from '../cloud-runner.ts';
|
import CloudRunner from '../cloud-runner.ts';
|
||||||
import { CloudRunnerStatics } from '../cloud-runner-statics.ts';
|
import { CloudRunnerStatics } from '../cloud-runner-statics.ts';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import CloudRunnerLogger from '../services/cloud-runner-logger.ts';
|
import CloudRunnerLogger from '../services/cloud-runner-logger.ts';
|
||||||
import CloudRunnerSecret from '../services/cloud-runner-secret.ts';
|
import CloudRunnerSecret from '../services/cloud-runner-secret.ts';
|
||||||
import { CloudRunnerFolders } from '../services/cloud-runner-folders.ts';
|
import { CloudRunnerFolders } from '../services/cloud-runner-folders.ts';
|
||||||
import YAML from '../../../../node_modules/yaml';
|
import { yaml } from '../../../dependencies.ts';
|
||||||
import { CloudRunner, Input } from '../../index.ts';
|
import { CloudRunner, Input } from '../../index.ts';
|
||||||
|
|
||||||
export class CustomWorkflow {
|
export class CustomWorkflow {
|
||||||
|
|
@ -12,7 +12,7 @@ export class CustomWorkflow {
|
||||||
CloudRunnerLogger.log(`Parsing build steps: ${buildSteps}`);
|
CloudRunnerLogger.log(`Parsing build steps: ${buildSteps}`);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
buildSteps = YAML.parse(buildSteps);
|
buildSteps = yaml.parse(buildSteps);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
CloudRunnerLogger.log(`failed to parse a custom job "${buildSteps}"`);
|
CloudRunnerLogger.log(`failed to parse a custom job "${buildSteps}"`);
|
||||||
throw error;
|
throw error;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { fsSync as fs, path, YAML, __dirname } from '../../dependencies.ts';
|
import { fsSync as fs, path, yaml, __dirname } from '../../dependencies.ts';
|
||||||
|
|
||||||
export class ActionYamlReader {
|
export class ActionYamlReader {
|
||||||
private actionYamlParsed: any;
|
private actionYamlParsed: any;
|
||||||
|
|
@ -7,7 +7,7 @@ export class ActionYamlReader {
|
||||||
if (!fs.existsSync(filename)) {
|
if (!fs.existsSync(filename)) {
|
||||||
filename = path.join(__dirname, `..`, filename);
|
filename = path.join(__dirname, `..`, filename);
|
||||||
}
|
}
|
||||||
this.actionYamlParsed = YAML.parse(fs.readFileSync(filename).toString());
|
this.actionYamlParsed = yaml.parse(fs.readFileSync(filename).toString());
|
||||||
}
|
}
|
||||||
public GetActionYamlValue(key: string) {
|
public GetActionYamlValue(key: string) {
|
||||||
return this.actionYamlParsed.inputs[key]?.description || 'No description found in action.yml';
|
return this.actionYamlParsed.inputs[key]?.description || 'No description found in action.yml';
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { fsSync as fs, path, YAML, __dirname } from '../../dependencies.ts';
|
import { fsSync as fs, path, yaml, __dirname } from '../../dependencies.ts';
|
||||||
import Input from '../input.ts';
|
import Input from '../input.ts';
|
||||||
|
|
||||||
export function ReadLicense() {
|
export function ReadLicense() {
|
||||||
|
|
@ -7,5 +7,5 @@ export function ReadLicense() {
|
||||||
}
|
}
|
||||||
const pipelineFile = path.join(__dirname, `.github`, `workflows`, `cloud-runner-k8s-pipeline.yml`);
|
const pipelineFile = path.join(__dirname, `.github`, `workflows`, `cloud-runner-k8s-pipeline.yml`);
|
||||||
|
|
||||||
return fs.existsSync(pipelineFile) ? YAML.parse(fs.readFileSync(pipelineFile, 'utf8')).env.UNITY_LICENSE : '';
|
return fs.existsSync(pipelineFile) ? yaml.parse(fs.readFileSync(pipelineFile, 'utf8')).env.UNITY_LICENSE : '';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,8 @@
|
||||||
import { fs, path } from '../dependencies.ts';
|
import { fs, path, core } from '../dependencies.ts';
|
||||||
import { Cli } from './cli/cli.ts';
|
import { Cli } from './cli/cli.ts';
|
||||||
import CloudRunnerQueryOverride from './cloud-runner/services/cloud-runner-query-override.ts';
|
import CloudRunnerQueryOverride from './cloud-runner/services/cloud-runner-query-override.ts';
|
||||||
import Platform from './platform.ts';
|
import Platform from './platform.ts';
|
||||||
|
|
||||||
const core = require('@actions/core');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Input variables specified in workflows using "with" prop.
|
* Input variables specified in workflows using "with" prop.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { exec } from '../../../node_modules/@actions/exec';
|
import { exec } from '../dependencies.ts';
|
||||||
import { BuildParameters } from './build-parameters.ts';
|
import { BuildParameters } from './build-parameters.ts';
|
||||||
|
|
||||||
class MacBuilder {
|
class MacBuilder {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
const core = require('@actions/core');
|
import { core } from '../dependencies.ts';
|
||||||
|
|
||||||
class Output {
|
class Output {
|
||||||
static async setBuildVersion(buildVersion) {
|
static async setBuildVersion(buildVersion) {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { BuildParameters } from '../index.ts';
|
import { BuildParameters } from '../index.ts';
|
||||||
import { fsSync as fs, exec, getUnityChangeset } from '../../dependencies.ts';
|
import { fsSync as fs, exec, getUnityChangeSet } from '../../dependencies.ts';
|
||||||
|
|
||||||
class SetupMac {
|
class SetupMac {
|
||||||
static unityHubPath = `"/Applications/Unity Hub.app/Contents/MacOS/Unity Hub"`;
|
static unityHubPath = `"/Applications/Unity Hub.app/Contents/MacOS/Unity Hub"`;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { core } from '../../dependencies.ts';
|
import { core } from '../dependencies.ts';
|
||||||
import NotImplementedException from './error/not-implemented-exception.ts';
|
import NotImplementedException from './error/not-implemented-exception.ts';
|
||||||
import ValidationError from './error/validation-error.ts';
|
import ValidationError from './error/validation-error.ts';
|
||||||
import Input from './input.ts';
|
import Input from './input.ts';
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue