cachePull cli

pull/353/head
Frostebite 2022-04-06 23:52:48 +01:00
parent 7b3ecc56e3
commit daf733d898
3 changed files with 24 additions and 13 deletions

15
dist/index.js vendored
View File

@ -582,11 +582,7 @@ class CLI {
return __awaiter(this, void 0, void 0, function* () {
try {
const buildParameter = JSON.parse(process.env.BUILD_PARAMETERS || '{}');
remote_client_logger_1.RemoteClientLogger.log(`Build Params:
${JSON.stringify(buildParameter, undefined, 4)}
`);
__1.CloudRunner.buildParameters = buildParameter;
cloud_runner_logger_1.default.log(`${CLI.options['cachePushFrom']} ${CLI.options['cachePushTo']} ${CLI.options['artifactName']}`);
yield caching_1.Caching.PushToCache(CLI.options['cachePushTo'], CLI.options['cachePushFrom'], CLI.options['artifactName']);
}
catch (error) {
@ -595,7 +591,16 @@ class CLI {
});
}
static cachePull() {
return __awaiter(this, void 0, void 0, function* () { });
return __awaiter(this, void 0, void 0, function* () {
try {
const buildParameter = JSON.parse(process.env.BUILD_PARAMETERS || '{}');
__1.CloudRunner.buildParameters = buildParameter;
yield caching_1.Caching.PullFromCache(CLI.options['cachePushFrom'], CLI.options['cachePushTo'], CLI.options['artifactName']);
}
catch (error) {
cloud_runner_logger_1.default.log(`${error}`);
}
});
}
static garbageCollectAws() {
return __awaiter(this, void 0, void 0, function* () {

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -100,13 +100,7 @@ export class CLI {
static async cachePush() {
try {
const buildParameter = JSON.parse(process.env.BUILD_PARAMETERS || '{}');
RemoteClientLogger.log(`Build Params:
${JSON.stringify(buildParameter, undefined, 4)}
`);
CloudRunner.buildParameters = buildParameter;
CloudRunnerLogger.log(
`${CLI.options['cachePushFrom']} ${CLI.options['cachePushTo']} ${CLI.options['artifactName']}`,
);
await Caching.PushToCache(CLI.options['cachePushTo'], CLI.options['cachePushFrom'], CLI.options['artifactName']);
} catch (error: any) {
CloudRunnerLogger.log(`${error}`);
@ -114,7 +108,19 @@ export class CLI {
}
@CliFunction(`cache-pull`, `pull from cache`)
static async cachePull() {}
static async cachePull() {
try {
const buildParameter = JSON.parse(process.env.BUILD_PARAMETERS || '{}');
CloudRunner.buildParameters = buildParameter;
await Caching.PullFromCache(
CLI.options['cachePushFrom'],
CLI.options['cachePushTo'],
CLI.options['artifactName'],
);
} catch (error: any) {
CloudRunnerLogger.log(`${error}`);
}
}
@CliFunction(`garbage-collect-aws`, `garbage collect aws`)
static async garbageCollectAws() {