pull/353/head
Frostebite 2022-04-07 00:33:26 +01:00
parent b36d1a0db6
commit 443b682da6
5 changed files with 24 additions and 7 deletions

16
dist/index.js vendored
View File

@ -500,6 +500,7 @@ const setup_cloud_runner_repository_1 = __nccwpck_require__(39656);
const SDK = __importStar(__nccwpck_require__(71786)); const SDK = __importStar(__nccwpck_require__(71786));
const caching_1 = __nccwpck_require__(38759); const caching_1 = __nccwpck_require__(38759);
const cloud_runner_query_override_1 = __importDefault(__nccwpck_require__(31011)); const cloud_runner_query_override_1 = __importDefault(__nccwpck_require__(31011));
const lfs_hashing_1 = __nccwpck_require__(31938);
class CLI { class CLI {
static get cliMode() { static get cliMode() {
return CLI.options !== undefined && CLI.options.mode !== undefined && CLI.options.mode !== ''; return CLI.options !== undefined && CLI.options.mode !== undefined && CLI.options.mode !== '';
@ -622,6 +623,12 @@ class CLI {
cloud_runner_logger_1.default.log(JSON.stringify(yield ecs.describeClusters().promise(), undefined, 4)); cloud_runner_logger_1.default.log(JSON.stringify(yield ecs.describeClusters().promise(), undefined, 4));
}); });
} }
static hash() {
return __awaiter(this, void 0, void 0, function* () {
const folder = CLI.options['cachePushFrom'];
lfs_hashing_1.LFSHashing.hashAllFiles(folder);
});
}
} }
__decorate([ __decorate([
cli_decorator_1.CliFunction(`cli`, `runs a cloud runner build`) cli_decorator_1.CliFunction(`cli`, `runs a cloud runner build`)
@ -638,6 +645,9 @@ __decorate([
__decorate([ __decorate([
cli_decorator_1.CliFunction(`garbage-collect-aws`, `garbage collect aws`) cli_decorator_1.CliFunction(`garbage-collect-aws`, `garbage collect aws`)
], CLI, "garbageCollectAws", null); ], CLI, "garbageCollectAws", null);
__decorate([
cli_decorator_1.CliFunction(`hash`, `hash all folder contents`)
], CLI, "hash", null);
exports.CLI = CLI; exports.CLI = CLI;
@ -1001,6 +1011,7 @@ class SetupCloudRunnerRepository {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
cloud_runner_logger_1.default.log(`Size of ${message}`); cloud_runner_logger_1.default.log(`Size of ${message}`);
yield cloud_runner_system_1.CloudRunnerSystem.Run(`du -sh ${folder}`); yield cloud_runner_system_1.CloudRunnerSystem.Run(`du -sh ${folder}`);
yield cloud_runner_system_1.CloudRunnerSystem.Run(`du -h ${folder}`);
}); });
} }
static cloneRepoWithoutLFSFiles() { static cloneRepoWithoutLFSFiles() {
@ -3463,7 +3474,6 @@ class BuildAutomationWorkflow {
node ${builderPath} -m remote-cli`; node ${builderPath} -m remote-cli`;
} }
static BuildCommands(builderPath) { static BuildCommands(builderPath) {
const guid = cloud_runner_1.default.buildParameters.buildGuid;
const linuxCacheFolder = cloud_runner_folders_1.CloudRunnerFolders.cacheFolderFull.replace(/\\/g, `/`); const linuxCacheFolder = cloud_runner_folders_1.CloudRunnerFolders.cacheFolderFull.replace(/\\/g, `/`);
const distFolder = path_1.default.join(cloud_runner_folders_1.CloudRunnerFolders.builderPathFull, 'dist'); const distFolder = path_1.default.join(cloud_runner_folders_1.CloudRunnerFolders.builderPathFull, 'dist');
const ubuntuPlatformsFolder = path_1.default.join(cloud_runner_folders_1.CloudRunnerFolders.builderPathFull, 'dist', 'platforms', 'ubuntu'); const ubuntuPlatformsFolder = path_1.default.join(cloud_runner_folders_1.CloudRunnerFolders.builderPathFull, 'dist', 'platforms', 'ubuntu');
@ -3477,9 +3487,9 @@ class BuildAutomationWorkflow {
/entrypoint.sh /entrypoint.sh
echo "game ci cloud runner push library to cache" echo "game ci cloud runner push library to cache"
chmod +x ${builderPath} chmod +x ${builderPath}
node ${builderPath} -m cache-push --cachePushFrom Library --artifactName lib-${guid} --cachePushTo ${linuxCacheFolder}/Library node ${builderPath} -m cache-push --cachePushFrom Library --cachePushTo ${linuxCacheFolder}/Library
echo "game ci cloud runner push build to cache" echo "game ci cloud runner push build to cache"
node ${builderPath} -m cache-push --cachePushFrom build --artifactName build-${guid} --cachePushTo ${linuxCacheFolder}/build`; node ${builderPath} -m cache-push --cachePushFrom build --cachePushTo ${linuxCacheFolder}/build`;
} }
} }
exports.BuildAutomationWorkflow = BuildAutomationWorkflow; exports.BuildAutomationWorkflow = BuildAutomationWorkflow;

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -9,6 +9,7 @@ import { SetupCloudRunnerRepository } from './remote-client/setup-cloud-runner-r
import * as SDK from 'aws-sdk'; import * as SDK from 'aws-sdk';
import { Caching } from './remote-client/remote-client-services/caching'; import { Caching } from './remote-client/remote-client-services/caching';
import CloudRunnerQueryOverride from '../cloud-runner/services/cloud-runner-query-override'; import CloudRunnerQueryOverride from '../cloud-runner/services/cloud-runner-query-override';
import { LFSHashing } from './remote-client/remote-client-services/lfs-hashing';
export class CLI { export class CLI {
public static options; public static options;
@ -144,4 +145,10 @@ export class CLI {
CloudRunnerLogger.log(JSON.stringify(await ecs.listClusters().promise(), undefined, 4)); CloudRunnerLogger.log(JSON.stringify(await ecs.listClusters().promise(), undefined, 4));
CloudRunnerLogger.log(JSON.stringify(await ecs.describeClusters().promise(), undefined, 4)); CloudRunnerLogger.log(JSON.stringify(await ecs.describeClusters().promise(), undefined, 4));
} }
@CliFunction(`hash`, `hash all folder contents`)
static async hash() {
const folder = CLI.options['cachePushFrom'];
LFSHashing.hashAllFiles(folder);
}
} }

View File

@ -46,6 +46,7 @@ export class SetupCloudRunnerRepository {
private static async sizeOfFolder(message: string, folder: string) { private static async sizeOfFolder(message: string, folder: string) {
CloudRunnerLogger.log(`Size of ${message}`); CloudRunnerLogger.log(`Size of ${message}`);
await CloudRunnerSystem.Run(`du -sh ${folder}`); await CloudRunnerSystem.Run(`du -sh ${folder}`);
await CloudRunnerSystem.Run(`du -h ${folder}`);
} }
private static async cloneRepoWithoutLFSFiles() { private static async cloneRepoWithoutLFSFiles() {

View File

@ -95,7 +95,6 @@ export class BuildAutomationWorkflow implements WorkflowInterface {
} }
private static BuildCommands(builderPath) { private static BuildCommands(builderPath) {
const guid = CloudRunner.buildParameters.buildGuid;
const linuxCacheFolder = CloudRunnerFolders.cacheFolderFull.replace(/\\/g, `/`); const linuxCacheFolder = CloudRunnerFolders.cacheFolderFull.replace(/\\/g, `/`);
const distFolder = path.join(CloudRunnerFolders.builderPathFull, 'dist'); const distFolder = path.join(CloudRunnerFolders.builderPathFull, 'dist');
const ubuntuPlatformsFolder = path.join(CloudRunnerFolders.builderPathFull, 'dist', 'platforms', 'ubuntu'); const ubuntuPlatformsFolder = path.join(CloudRunnerFolders.builderPathFull, 'dist', 'platforms', 'ubuntu');
@ -109,8 +108,8 @@ export class BuildAutomationWorkflow implements WorkflowInterface {
/entrypoint.sh /entrypoint.sh
echo "game ci cloud runner push library to cache" echo "game ci cloud runner push library to cache"
chmod +x ${builderPath} chmod +x ${builderPath}
node ${builderPath} -m cache-push --cachePushFrom Library --artifactName lib-${guid} --cachePushTo ${linuxCacheFolder}/Library node ${builderPath} -m cache-push --cachePushFrom Library --cachePushTo ${linuxCacheFolder}/Library
echo "game ci cloud runner push build to cache" echo "game ci cloud runner push build to cache"
node ${builderPath} -m cache-push --cachePushFrom build --artifactName build-${guid} --cachePushTo ${linuxCacheFolder}/build`; node ${builderPath} -m cache-push --cachePushFrom build --cachePushTo ${linuxCacheFolder}/build`;
} }
} }