Cleanup
parent
c3c69cde8d
commit
166c44f0fd
|
|
@ -80,3 +80,14 @@ jobs:
|
||||||
githubToken: ${{ secrets.GITHUB_TOKEN }}
|
githubToken: ${{ secrets.GITHUB_TOKEN }}
|
||||||
awsBaseStackName: game-ci-stack-integration-tests
|
awsBaseStackName: game-ci-stack-integration-tests
|
||||||
CloudRunnerBranch: remote-builder/unified-providers
|
CloudRunnerBranch: remote-builder/unified-providers
|
||||||
|
postBuildSteps: |
|
||||||
|
name: upload
|
||||||
|
image: amazon/aws-cli
|
||||||
|
commands: ['aws s3 list-buckets']
|
||||||
|
secrets:
|
||||||
|
- name: AWS_ACCESS_KEY_ID
|
||||||
|
value: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
|
- name: AWS_SECRET_ACCESS_KEY
|
||||||
|
value: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
|
- name: AWS_DEFAULT_REGION
|
||||||
|
value: eu-west-2
|
||||||
|
|
|
||||||
|
|
@ -393,7 +393,6 @@ const cloud_runner_logger_1 = __importDefault(__webpack_require__(22855));
|
||||||
class CLI {
|
class CLI {
|
||||||
static RunCli(options) {
|
static RunCli(options) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
core.info(`Entrypoint: ${options.mode}`);
|
|
||||||
const container = new Array();
|
const container = new Array();
|
||||||
container.push({
|
container.push({
|
||||||
key: `remote-cli`,
|
key: `remote-cli`,
|
||||||
|
|
@ -412,7 +411,7 @@ class CLI {
|
||||||
if (results.length === 0) {
|
if (results.length === 0) {
|
||||||
throw new Error('no CLI mode found');
|
throw new Error('no CLI mode found');
|
||||||
}
|
}
|
||||||
cloud_runner_logger_1.default.log(results[0].key);
|
cloud_runner_logger_1.default.log(`Entrypoint: ${results[0]}`);
|
||||||
return yield results[0].asyncFunc();
|
return yield results[0].asyncFunc();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -622,14 +621,21 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.RemoteClient = void 0;
|
exports.RemoteClient = void 0;
|
||||||
|
const cloud_runner_logger_1 = __importDefault(__webpack_require__(22855));
|
||||||
const cloud_runner_state_1 = __webpack_require__(70912);
|
const cloud_runner_state_1 = __webpack_require__(70912);
|
||||||
const setup_cloud_runner_repository_1 = __webpack_require__(39656);
|
const setup_cloud_runner_repository_1 = __webpack_require__(39656);
|
||||||
class RemoteClient {
|
class RemoteClient {
|
||||||
static Run() {
|
static Run() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
const buildParameter = JSON.parse(process.env.buildParameters || '{}');
|
const buildParameter = JSON.parse(process.env.buildParameters || '{}');
|
||||||
|
cloud_runner_logger_1.default.log(`Build Params:
|
||||||
|
${JSON.stringify(buildParameter, undefined, 4)}
|
||||||
|
`);
|
||||||
cloud_runner_state_1.CloudRunnerState.setup(buildParameter);
|
cloud_runner_state_1.CloudRunnerState.setup(buildParameter);
|
||||||
yield setup_cloud_runner_repository_1.SetupCloudRunnerRepository.run();
|
yield setup_cloud_runner_repository_1.SetupCloudRunnerRepository.run();
|
||||||
});
|
});
|
||||||
|
|
@ -2564,7 +2570,7 @@ class TaskParameterSerializer {
|
||||||
let array = new Array();
|
let array = new Array();
|
||||||
array = TaskParameterSerializer.readBuildParameters(array);
|
array = TaskParameterSerializer.readBuildParameters(array);
|
||||||
array = TaskParameterSerializer.readInput(array);
|
array = TaskParameterSerializer.readInput(array);
|
||||||
array = array.filter((x) => x.value !== undefined && x.name !== '0' && x.value !== '');
|
array = array.filter((x) => x.value !== undefined && x.name !== '0' && x.value !== '' && x.name !== 'prototype' && x.name !== 'length');
|
||||||
array = array.map((x) => {
|
array = array.map((x) => {
|
||||||
x.name = __1.Input.ToEnvVarFormat(x.name);
|
x.name = __1.Input.ToEnvVarFormat(x.name);
|
||||||
x.value = `${x.value}`;
|
x.value = `${x.value}`;
|
||||||
|
|
@ -3516,6 +3522,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
|
const fs_1 = __importDefault(__webpack_require__(35747));
|
||||||
|
const path_1 = __importDefault(__webpack_require__(85622));
|
||||||
const git_repo_1 = __webpack_require__(24271);
|
const git_repo_1 = __webpack_require__(24271);
|
||||||
const github_cli_1 = __webpack_require__(44990);
|
const github_cli_1 = __webpack_require__(44990);
|
||||||
const platform_1 = __importDefault(__webpack_require__(9707));
|
const platform_1 = __importDefault(__webpack_require__(9707));
|
||||||
|
|
@ -3552,21 +3560,14 @@ class Input {
|
||||||
return yield git_repo_1.GitRepoReader.GetBranch();
|
return yield git_repo_1.GitRepoReader.GetBranch();
|
||||||
}
|
}
|
||||||
else if (Input.getInput(`GITHUB_REF`)) {
|
else if (Input.getInput(`GITHUB_REF`)) {
|
||||||
return Input.getInput(`GITHUB_REF`)
|
return Input.getInput(`GITHUB_REF`).replace('refs/', '').replace(`head/`, '');
|
||||||
.split('/')
|
|
||||||
.map((x) => {
|
|
||||||
x = x[0].toUpperCase() + x.slice(1);
|
|
||||||
return x;
|
|
||||||
})
|
|
||||||
.join('');
|
|
||||||
}
|
}
|
||||||
else if (Input.getInput('branch')) {
|
else if (Input.getInput('branch')) {
|
||||||
return Input.getInput('branch');
|
return Input.getInput('branch');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return 'remote-builder/unified-providers';
|
return 'main';
|
||||||
}
|
}
|
||||||
//
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
static get gitSha() {
|
static get gitSha() {
|
||||||
|
|
@ -3593,7 +3594,13 @@ class Input {
|
||||||
return Input.getInput('targetPlatform') || platform_1.default.default;
|
return Input.getInput('targetPlatform') || platform_1.default.default;
|
||||||
}
|
}
|
||||||
static get projectPath() {
|
static get projectPath() {
|
||||||
const rawProjectPath = Input.getInput('projectPath') || '.';
|
const input = Input.getInput('projectPath');
|
||||||
|
const rawProjectPath = input
|
||||||
|
? input
|
||||||
|
: fs_1.default.existsSync(path_1.default.join('test-project', 'ProjectSettings', 'ProjectVersion.txt')) &&
|
||||||
|
!fs_1.default.existsSync(path_1.default.join('ProjectSettings', 'ProjectVersion.txt'))
|
||||||
|
? 'test-project'
|
||||||
|
: '.';
|
||||||
return rawProjectPath.replace(/\/$/, '');
|
return rawProjectPath.replace(/\/$/, '');
|
||||||
}
|
}
|
||||||
static get buildName() {
|
static get buildName() {
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -6,8 +6,6 @@ import { ActionYamlReader } from '../input-readers/action-yaml';
|
||||||
import CloudRunnerLogger from '../cloud-runner/services/cloud-runner-logger';
|
import CloudRunnerLogger from '../cloud-runner/services/cloud-runner-logger';
|
||||||
export class CLI {
|
export class CLI {
|
||||||
static async RunCli(options: any): Promise<void> {
|
static async RunCli(options: any): Promise<void> {
|
||||||
core.info(`Entrypoint: ${options.mode}`);
|
|
||||||
|
|
||||||
const container = new Array();
|
const container = new Array();
|
||||||
container.push(
|
container.push(
|
||||||
{
|
{
|
||||||
|
|
@ -31,7 +29,7 @@ export class CLI {
|
||||||
throw new Error('no CLI mode found');
|
throw new Error('no CLI mode found');
|
||||||
}
|
}
|
||||||
|
|
||||||
CloudRunnerLogger.log(results[0].key);
|
CloudRunnerLogger.log(`Entrypoint: ${results[0]}`);
|
||||||
|
|
||||||
return await results[0].asyncFunc();
|
return await results[0].asyncFunc();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,13 @@
|
||||||
|
import CloudRunnerLogger from '../../cloud-runner/services/cloud-runner-logger';
|
||||||
import { CloudRunnerState } from '../../cloud-runner/state/cloud-runner-state';
|
import { CloudRunnerState } from '../../cloud-runner/state/cloud-runner-state';
|
||||||
import { SetupCloudRunnerRepository } from './setup-cloud-runner-repository';
|
import { SetupCloudRunnerRepository } from './setup-cloud-runner-repository';
|
||||||
|
|
||||||
export class RemoteClient {
|
export class RemoteClient {
|
||||||
static async Run() {
|
static async Run() {
|
||||||
const buildParameter = JSON.parse(process.env.buildParameters || '{}');
|
const buildParameter = JSON.parse(process.env.buildParameters || '{}');
|
||||||
|
CloudRunnerLogger.log(`Build Params:
|
||||||
|
${JSON.stringify(buildParameter, undefined, 4)}
|
||||||
|
`);
|
||||||
CloudRunnerState.setup(buildParameter);
|
CloudRunnerState.setup(buildParameter);
|
||||||
await SetupCloudRunnerRepository.run();
|
await SetupCloudRunnerRepository.run();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,9 @@ describe('Cloud Runner', () => {
|
||||||
value: '${testSecretValue}'
|
value: '${testSecretValue}'
|
||||||
`,
|
`,
|
||||||
};
|
};
|
||||||
Input.githubEnabled = false;
|
|
||||||
it('All build parameters sent to cloud runner as env vars', async () => {
|
|
||||||
if (Input.cloudRunnerTests) {
|
if (Input.cloudRunnerTests) {
|
||||||
|
it('All build parameters sent to cloud runner as env vars', async () => {
|
||||||
|
Input.githubEnabled = false;
|
||||||
const buildParameter = await BuildParameters.create();
|
const buildParameter = await BuildParameters.create();
|
||||||
const baseImage = new ImageTag(buildParameter);
|
const baseImage = new ImageTag(buildParameter);
|
||||||
const file = await CloudRunner.run(buildParameter, baseImage.toString());
|
const file = await CloudRunner.run(buildParameter, baseImage.toString());
|
||||||
|
|
@ -44,6 +44,6 @@ describe('Cloud Runner', () => {
|
||||||
expect(newLinePurgedFile).toContain(`${element.name}=${element.value}`);
|
expect(newLinePurgedFile).toContain(`${element.name}=${element.value}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}, 1000000);
|
}, 1000000);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,9 @@ export class TaskParameterSerializer {
|
||||||
array = TaskParameterSerializer.readBuildParameters(array);
|
array = TaskParameterSerializer.readBuildParameters(array);
|
||||||
array = TaskParameterSerializer.readInput(array);
|
array = TaskParameterSerializer.readInput(array);
|
||||||
|
|
||||||
array = array.filter((x) => x.value !== undefined && x.name !== '0' && x.value !== '');
|
array = array.filter(
|
||||||
|
(x) => x.value !== undefined && x.name !== '0' && x.value !== '' && x.name !== 'prototype' && x.name !== 'length',
|
||||||
|
);
|
||||||
array = array.map((x) => {
|
array = array.map((x) => {
|
||||||
x.name = Input.ToEnvVarFormat(x.name);
|
x.name = Input.ToEnvVarFormat(x.name);
|
||||||
x.value = `${x.value}`;
|
x.value = `${x.value}`;
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ describe('Input', () => {
|
||||||
|
|
||||||
describe('projectPath', () => {
|
describe('projectPath', () => {
|
||||||
it('returns the default value', () => {
|
it('returns the default value', () => {
|
||||||
expect(Input.projectPath).toStrictEqual('.');
|
expect(Input.projectPath).toStrictEqual('test-project');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('takes input from the users workflow', () => {
|
it('takes input from the users workflow', () => {
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
import fs from 'fs';
|
||||||
|
import path from 'path';
|
||||||
import { GitRepoReader } from './input-readers/git-repo';
|
import { GitRepoReader } from './input-readers/git-repo';
|
||||||
import { GithubCliReader } from './input-readers/github-cli';
|
import { GithubCliReader } from './input-readers/github-cli';
|
||||||
import Platform from './platform';
|
import Platform from './platform';
|
||||||
|
|
@ -36,19 +38,12 @@ class Input {
|
||||||
if (await GitRepoReader.GetBranch()) {
|
if (await GitRepoReader.GetBranch()) {
|
||||||
return await GitRepoReader.GetBranch();
|
return await GitRepoReader.GetBranch();
|
||||||
} else if (Input.getInput(`GITHUB_REF`)) {
|
} else if (Input.getInput(`GITHUB_REF`)) {
|
||||||
return Input.getInput(`GITHUB_REF`)
|
return Input.getInput(`GITHUB_REF`).replace('refs/', '').replace(`head/`, '');
|
||||||
.split('/')
|
|
||||||
.map((x) => {
|
|
||||||
x = x[0].toUpperCase() + x.slice(1);
|
|
||||||
return x;
|
|
||||||
})
|
|
||||||
.join('');
|
|
||||||
} else if (Input.getInput('branch')) {
|
} else if (Input.getInput('branch')) {
|
||||||
return Input.getInput('branch');
|
return Input.getInput('branch');
|
||||||
} else {
|
} else {
|
||||||
return 'remote-builder/unified-providers';
|
return 'main';
|
||||||
}
|
}
|
||||||
//
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static get gitSha() {
|
static get gitSha() {
|
||||||
|
|
@ -77,7 +72,13 @@ class Input {
|
||||||
}
|
}
|
||||||
|
|
||||||
static get projectPath() {
|
static get projectPath() {
|
||||||
const rawProjectPath = Input.getInput('projectPath') || '.';
|
const input = Input.getInput('projectPath');
|
||||||
|
const rawProjectPath = input
|
||||||
|
? input
|
||||||
|
: fs.existsSync(path.join('test-project', 'ProjectSettings', 'ProjectVersion.txt')) &&
|
||||||
|
!fs.existsSync(path.join('ProjectSettings', 'ProjectVersion.txt'))
|
||||||
|
? 'test-project'
|
||||||
|
: '.';
|
||||||
return rawProjectPath.replace(/\/$/, '');
|
return rawProjectPath.replace(/\/$/, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue