import cli files explicitly

pull/353/head
Frostebite 2022-04-07 21:15:12 +01:00
parent 46d90435d3
commit cd7c4fc6ad
13 changed files with 182 additions and 174 deletions

324
dist/index.js vendored
View File

@ -504,7 +504,7 @@ const cloud_runner_query_override_1 = __importDefault(__nccwpck_require__(31011)
const cli_functions_repository_1 = __nccwpck_require__(85301); const cli_functions_repository_1 = __nccwpck_require__(85301);
const aws_cli_commands_1 = __nccwpck_require__(6371); const aws_cli_commands_1 = __nccwpck_require__(6371);
const caching_1 = __nccwpck_require__(32885); const caching_1 = __nccwpck_require__(32885);
const lfs_hashing_1 = __nccwpck_require__(85204); const lfs_hashing_1 = __nccwpck_require__(8915);
const setup_cloud_runner_repository_1 = __nccwpck_require__(68258); const setup_cloud_runner_repository_1 = __nccwpck_require__(68258);
class CLI { class CLI {
static get cliMode() { static get cliMode() {
@ -2130,7 +2130,7 @@ 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 cloud_runner_system_1 = __nccwpck_require__(46920); const cloud_runner_system_1 = __nccwpck_require__(99393);
const cloud_runner_logger_1 = __importDefault(__nccwpck_require__(22855)); const cloud_runner_logger_1 = __importDefault(__nccwpck_require__(22855));
class LocalDockerCloudRunner { class LocalDockerCloudRunner {
cleanupSharedResources( cleanupSharedResources(
@ -2190,7 +2190,7 @@ 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 cloud_runner_system_1 = __nccwpck_require__(46920); const cloud_runner_system_1 = __nccwpck_require__(99393);
const cloud_runner_logger_1 = __importDefault(__nccwpck_require__(22855)); const cloud_runner_logger_1 = __importDefault(__nccwpck_require__(22855));
class LocalCloudRunner { class LocalCloudRunner {
cleanupSharedResources( cleanupSharedResources(
@ -2533,8 +2533,8 @@ const path_1 = __importDefault(__nccwpck_require__(71017));
const cloud_runner_1 = __importDefault(__nccwpck_require__(79144)); const cloud_runner_1 = __importDefault(__nccwpck_require__(79144));
const cloud_runner_logger_1 = __importDefault(__nccwpck_require__(22855)); const cloud_runner_logger_1 = __importDefault(__nccwpck_require__(22855));
const cloud_runner_folders_1 = __nccwpck_require__(13527); const cloud_runner_folders_1 = __nccwpck_require__(13527);
const cloud_runner_system_1 = __nccwpck_require__(46920); const cloud_runner_system_1 = __nccwpck_require__(99393);
const lfs_hashing_1 = __nccwpck_require__(85204); const lfs_hashing_1 = __nccwpck_require__(8915);
const remote_client_logger_1 = __nccwpck_require__(59412); const remote_client_logger_1 = __nccwpck_require__(59412);
const cli_1 = __nccwpck_require__(55651); const cli_1 = __nccwpck_require__(55651);
const cli_functions_repository_1 = __nccwpck_require__(85301); const cli_functions_repository_1 = __nccwpck_require__(85301);
@ -2565,6 +2565,8 @@ class Caching {
} }
static PushToCache(cacheFolder, sourceFolder, cacheArtifactName) { static PushToCache(cacheFolder, sourceFolder, cacheArtifactName) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
cloud_runner_system_1.CloudRunnerSystem.Run(`ls ${cacheFolder}`);
cloud_runner_system_1.CloudRunnerSystem.Run(`ls ${sourceFolder}`);
cacheArtifactName = cacheArtifactName.replace(' ', ''); cacheArtifactName = cacheArtifactName.replace(' ', '');
const startPath = process.cwd(); const startPath = process.cwd();
try { try {
@ -2601,6 +2603,8 @@ class Caching {
} }
static PullFromCache(cacheFolder, destinationFolder, cacheArtifactName = ``) { static PullFromCache(cacheFolder, destinationFolder, cacheArtifactName = ``) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
cloud_runner_system_1.CloudRunnerSystem.Run(`ls ${cacheFolder}`);
cloud_runner_system_1.CloudRunnerSystem.Run(`ls ${destinationFolder}`);
cacheArtifactName = cacheArtifactName.replace(' ', ''); cacheArtifactName = cacheArtifactName.replace(' ', '');
const startPath = process.cwd(); const startPath = process.cwd();
remote_client_logger_1.RemoteClientLogger.log(`Caching for ${path_1.default.basename(destinationFolder)}`); remote_client_logger_1.RemoteClientLogger.log(`Caching for ${path_1.default.basename(destinationFolder)}`);
@ -2673,155 +2677,6 @@ __decorate([
exports.Caching = Caching; exports.Caching = Caching;
/***/ }),
/***/ 46920:
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.CloudRunnerSystem = void 0;
const child_process_1 = __nccwpck_require__(32081);
const remote_client_logger_1 = __nccwpck_require__(59412);
class CloudRunnerSystem {
static Run(command, suppressError = false, suppressLogs = false) {
return __awaiter(this, void 0, void 0, function* () {
for (const element of command.split(`\n`)) {
if (!suppressLogs) {
remote_client_logger_1.RemoteClientLogger.log(element);
}
}
return yield new Promise((promise, throwError) => {
let output = '';
const child = child_process_1.exec(command, (error, stdout, stderr) => {
if (!suppressError && error) {
remote_client_logger_1.RemoteClientLogger.log(error.toString());
throwError(error);
}
if (stderr) {
const diagnosticOutput = `${stderr.toString()}`;
if (!suppressLogs) {
remote_client_logger_1.RemoteClientLogger.logCliDiagnostic(diagnosticOutput);
}
output += diagnosticOutput;
}
const outputChunk = `${stdout}`;
output += outputChunk;
});
child.on('close', (code) => {
if (!suppressLogs) {
remote_client_logger_1.RemoteClientLogger.log(`[${code}]`);
}
if (code !== 0 && !suppressError) {
throwError(output);
}
const outputLines = output.split(`\n`);
for (const element of outputLines) {
if (!suppressLogs) {
remote_client_logger_1.RemoteClientLogger.log(element);
}
}
promise(output);
});
});
});
}
}
exports.CloudRunnerSystem = CloudRunnerSystem;
/***/ }),
/***/ 85204:
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
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 }));
exports.LFSHashing = void 0;
const path_1 = __importDefault(__nccwpck_require__(71017));
const cloud_runner_folders_1 = __nccwpck_require__(13527);
const cloud_runner_system_1 = __nccwpck_require__(46920);
const fs_1 = __importDefault(__nccwpck_require__(57147));
const console_1 = __nccwpck_require__(96206);
const cli_1 = __nccwpck_require__(55651);
const cli_functions_repository_1 = __nccwpck_require__(85301);
class LFSHashing {
static createLFSHashFiles() {
return __awaiter(this, void 0, void 0, function* () {
try {
yield cloud_runner_system_1.CloudRunnerSystem.Run(`git lfs ls-files -l | cut -d ' ' -f1 | sort > .lfs-assets-guid`);
yield cloud_runner_system_1.CloudRunnerSystem.Run(`md5sum .lfs-assets-guid > .lfs-assets-guid-sum`);
console_1.assert(fs_1.default.existsSync(`.lfs-assets-guid-sum`));
console_1.assert(fs_1.default.existsSync(`.lfs-assets-guid`));
const lfsHashes = {
lfsGuid: fs_1.default
.readFileSync(`${path_1.default.join(cloud_runner_folders_1.CloudRunnerFolders.repoPathFull, `.lfs-assets-guid`)}`, 'utf8')
.replace(/\n/g, ``),
lfsGuidSum: fs_1.default
.readFileSync(`${path_1.default.join(cloud_runner_folders_1.CloudRunnerFolders.repoPathFull, `.lfs-assets-guid-sum`)}`, 'utf8')
.replace(' .lfs-assets-guid', '')
.replace(/\n/g, ``),
};
return lfsHashes;
}
catch (error) {
throw error;
}
});
}
static hashAllFiles(folder) {
return __awaiter(this, void 0, void 0, function* () {
const startPath = process.cwd();
process.chdir(folder);
const result = yield (yield cloud_runner_system_1.CloudRunnerSystem.Run(`find -type f -exec md5sum "{}" + | sort | md5sum`))
.replace(/\n/g, '')
.split(` `)[0];
process.chdir(startPath);
return result;
});
}
static hash() {
return __awaiter(this, void 0, void 0, function* () {
const folder = cli_1.CLI.options['cachePushFrom'];
LFSHashing.hashAllFiles(folder);
});
}
}
__decorate([
cli_functions_repository_1.CliFunction(`hash`, `hash all folder contents`)
], LFSHashing, "hash", null);
exports.LFSHashing = LFSHashing;
/***/ }), /***/ }),
/***/ 59412: /***/ 59412:
@ -2883,13 +2738,13 @@ const fs_1 = __importDefault(__nccwpck_require__(57147));
const cloud_runner_1 = __importDefault(__nccwpck_require__(79144)); const cloud_runner_1 = __importDefault(__nccwpck_require__(79144));
const cloud_runner_folders_1 = __nccwpck_require__(13527); const cloud_runner_folders_1 = __nccwpck_require__(13527);
const caching_1 = __nccwpck_require__(32885); const caching_1 = __nccwpck_require__(32885);
const lfs_hashing_1 = __nccwpck_require__(85204); const lfs_hashing_1 = __nccwpck_require__(8915);
const cloud_runner_system_1 = __nccwpck_require__(46920);
const remote_client_logger_1 = __nccwpck_require__(59412); const remote_client_logger_1 = __nccwpck_require__(59412);
const path_1 = __importDefault(__nccwpck_require__(71017)); const path_1 = __importDefault(__nccwpck_require__(71017));
const console_1 = __nccwpck_require__(96206); const console_1 = __nccwpck_require__(96206);
const cloud_runner_logger_1 = __importDefault(__nccwpck_require__(22855)); const cloud_runner_logger_1 = __importDefault(__nccwpck_require__(22855));
const cli_functions_repository_1 = __nccwpck_require__(85301); const cli_functions_repository_1 = __nccwpck_require__(85301);
const cloud_runner_system_1 = __nccwpck_require__(99393);
class SetupCloudRunnerRepository { class SetupCloudRunnerRepository {
static run() { static run() {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
@ -3258,6 +3113,73 @@ class CloudRunnerQueryOverride {
exports["default"] = CloudRunnerQueryOverride; exports["default"] = CloudRunnerQueryOverride;
/***/ }),
/***/ 99393:
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.CloudRunnerSystem = void 0;
const child_process_1 = __nccwpck_require__(32081);
const remote_client_logger_1 = __nccwpck_require__(59412);
class CloudRunnerSystem {
static Run(command, suppressError = false, suppressLogs = false) {
return __awaiter(this, void 0, void 0, function* () {
for (const element of command.split(`\n`)) {
if (!suppressLogs) {
remote_client_logger_1.RemoteClientLogger.log(element);
}
}
return yield new Promise((promise, throwError) => {
let output = '';
const child = child_process_1.exec(command, (error, stdout, stderr) => {
if (!suppressError && error) {
remote_client_logger_1.RemoteClientLogger.log(error.toString());
throwError(error);
}
if (stderr) {
const diagnosticOutput = `${stderr.toString()}`;
if (!suppressLogs) {
remote_client_logger_1.RemoteClientLogger.logCliDiagnostic(diagnosticOutput);
}
output += diagnosticOutput;
}
const outputChunk = `${stdout}`;
output += outputChunk;
});
child.on('close', (code) => {
if (!suppressLogs) {
remote_client_logger_1.RemoteClientLogger.log(`[${code}]`);
}
if (code !== 0 && !suppressError) {
throwError(output);
}
const outputLines = output.split(`\n`);
for (const element of outputLines) {
if (!suppressLogs) {
remote_client_logger_1.RemoteClientLogger.log(element);
}
}
promise(output);
});
});
});
}
}
exports.CloudRunnerSystem = CloudRunnerSystem;
/***/ }), /***/ }),
/***/ 69862: /***/ 69862:
@ -3278,8 +3200,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 cloud_runner_system_1 = __nccwpck_require__(46920);
const input_1 = __importDefault(__nccwpck_require__(91933)); const input_1 = __importDefault(__nccwpck_require__(91933));
const cloud_runner_system_1 = __nccwpck_require__(99393);
class DependencyOverrideService { class DependencyOverrideService {
static CheckHealth() { static CheckHealth() {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
@ -3305,6 +3227,88 @@ class DependencyOverrideService {
exports["default"] = DependencyOverrideService; exports["default"] = DependencyOverrideService;
/***/ }),
/***/ 8915:
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
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 }));
exports.LFSHashing = void 0;
const path_1 = __importDefault(__nccwpck_require__(71017));
const cloud_runner_folders_1 = __nccwpck_require__(13527);
const cloud_runner_system_1 = __nccwpck_require__(99393);
const fs_1 = __importDefault(__nccwpck_require__(57147));
const console_1 = __nccwpck_require__(96206);
const cli_1 = __nccwpck_require__(55651);
const cli_functions_repository_1 = __nccwpck_require__(85301);
class LFSHashing {
static createLFSHashFiles() {
return __awaiter(this, void 0, void 0, function* () {
try {
yield cloud_runner_system_1.CloudRunnerSystem.Run(`git lfs ls-files -l | cut -d ' ' -f1 | sort > .lfs-assets-guid`);
yield cloud_runner_system_1.CloudRunnerSystem.Run(`md5sum .lfs-assets-guid > .lfs-assets-guid-sum`);
console_1.assert(fs_1.default.existsSync(`.lfs-assets-guid-sum`));
console_1.assert(fs_1.default.existsSync(`.lfs-assets-guid`));
const lfsHashes = {
lfsGuid: fs_1.default
.readFileSync(`${path_1.default.join(cloud_runner_folders_1.CloudRunnerFolders.repoPathFull, `.lfs-assets-guid`)}`, 'utf8')
.replace(/\n/g, ``),
lfsGuidSum: fs_1.default
.readFileSync(`${path_1.default.join(cloud_runner_folders_1.CloudRunnerFolders.repoPathFull, `.lfs-assets-guid-sum`)}`, 'utf8')
.replace(' .lfs-assets-guid', '')
.replace(/\n/g, ``),
};
return lfsHashes;
}
catch (error) {
throw error;
}
});
}
static hashAllFiles(folder) {
return __awaiter(this, void 0, void 0, function* () {
const startPath = process.cwd();
process.chdir(folder);
const result = yield (yield cloud_runner_system_1.CloudRunnerSystem.Run(`find -type f -exec md5sum "{}" + | sort | md5sum`))
.replace(/\n/g, '')
.split(` `)[0];
process.chdir(startPath);
return result;
});
}
static hash() {
return __awaiter(this, void 0, void 0, function* () {
const folder = cli_1.CLI.options['cachePushFrom'];
LFSHashing.hashAllFiles(folder);
});
}
}
__decorate([
cli_functions_repository_1.CliFunction(`hash`, `hash all folder contents`)
], LFSHashing, "hash", null);
exports.LFSHashing = LFSHashing;
/***/ }), /***/ }),
/***/ 35346: /***/ 35346:
@ -4117,7 +4121,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
}; };
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.GenericInputReader = void 0; exports.GenericInputReader = void 0;
const cloud_runner_system_1 = __nccwpck_require__(46920); const cloud_runner_system_1 = __nccwpck_require__(99393);
class GenericInputReader { class GenericInputReader {
static Run(command) { static Run(command) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
@ -4151,7 +4155,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.GitRepoReader = void 0; exports.GitRepoReader = void 0;
const console_1 = __nccwpck_require__(96206); const console_1 = __nccwpck_require__(96206);
const fs_1 = __importDefault(__nccwpck_require__(57147)); const fs_1 = __importDefault(__nccwpck_require__(57147));
const cloud_runner_system_1 = __nccwpck_require__(46920); const cloud_runner_system_1 = __nccwpck_require__(99393);
const cloud_runner_logger_1 = __importDefault(__nccwpck_require__(22855)); const cloud_runner_logger_1 = __importDefault(__nccwpck_require__(22855));
class GitRepoReader { class GitRepoReader {
static GetRemote() { static GetRemote() {
@ -4213,7 +4217,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
}; };
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.GithubCliReader = void 0; exports.GithubCliReader = void 0;
const cloud_runner_system_1 = __nccwpck_require__(46920); const cloud_runner_system_1 = __nccwpck_require__(99393);
const core = __importStar(__nccwpck_require__(42186)); const core = __importStar(__nccwpck_require__(42186));
class GithubCliReader { class GithubCliReader {
static GetGitHubAuthToken() { static GetGitHubAuthToken() {

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -7,7 +7,7 @@ import CloudRunnerQueryOverride from '../cloud-runner/services/cloud-runner-quer
import { CliFunction, CLIFunctionsRepository } from './cli-functions-repository'; import { CliFunction, CLIFunctionsRepository } from './cli-functions-repository';
import { AWSCLICommands } from '../cloud-runner/cloud-runner-providers/aws/commands/aws-cli-commands'; import { AWSCLICommands } from '../cloud-runner/cloud-runner-providers/aws/commands/aws-cli-commands';
import { Caching } from '../cloud-runner/remote-client/caching'; import { Caching } from '../cloud-runner/remote-client/caching';
import { LFSHashing } from '../cloud-runner/remote-client/lfs-hashing'; import { LFSHashing } from '../cloud-runner/services/lfs-hashing';
import { SetupCloudRunnerRepository } from '../cloud-runner/remote-client/setup-cloud-runner-repository'; import { SetupCloudRunnerRepository } from '../cloud-runner/remote-client/setup-cloud-runner-repository';
export class CLI { export class CLI {

View File

@ -1,5 +1,5 @@
import BuildParameters from '../../../build-parameters'; import BuildParameters from '../../../build-parameters';
import { CloudRunnerSystem } from '../../remote-client/cloud-runner-system'; import { CloudRunnerSystem } from '../../services/cloud-runner-system';
import CloudRunnerEnvironmentVariable from '../../services/cloud-runner-environment-variable'; import CloudRunnerEnvironmentVariable from '../../services/cloud-runner-environment-variable';
import CloudRunnerLogger from '../../services/cloud-runner-logger'; import CloudRunnerLogger from '../../services/cloud-runner-logger';
import { CloudRunnerProviderInterface } from '../cloud-runner-provider-interface'; import { CloudRunnerProviderInterface } from '../cloud-runner-provider-interface';

View File

@ -1,5 +1,5 @@
import BuildParameters from '../../../build-parameters'; import BuildParameters from '../../../build-parameters';
import { CloudRunnerSystem } from '../../remote-client/cloud-runner-system'; import { CloudRunnerSystem } from '../../services/cloud-runner-system';
import CloudRunnerEnvironmentVariable from '../../services/cloud-runner-environment-variable'; import CloudRunnerEnvironmentVariable from '../../services/cloud-runner-environment-variable';
import CloudRunnerLogger from '../../services/cloud-runner-logger'; import CloudRunnerLogger from '../../services/cloud-runner-logger';
import { CloudRunnerProviderInterface } from '../cloud-runner-provider-interface'; import { CloudRunnerProviderInterface } from '../cloud-runner-provider-interface';

View File

@ -4,8 +4,8 @@ import path from 'path';
import CloudRunner from '../cloud-runner'; import CloudRunner from '../cloud-runner';
import CloudRunnerLogger from '../services/cloud-runner-logger'; import CloudRunnerLogger from '../services/cloud-runner-logger';
import { CloudRunnerFolders } from '../services/cloud-runner-folders'; import { CloudRunnerFolders } from '../services/cloud-runner-folders';
import { CloudRunnerSystem } from './cloud-runner-system'; import { CloudRunnerSystem } from '../services/cloud-runner-system';
import { LFSHashing } from './lfs-hashing'; import { LFSHashing } from '../services/lfs-hashing';
import { RemoteClientLogger } from './remote-client-logger'; import { RemoteClientLogger } from './remote-client-logger';
import { CLI } from '../../cli/cli'; import { CLI } from '../../cli/cli';
import { CliFunction } from '../../cli/cli-functions-repository'; import { CliFunction } from '../../cli/cli-functions-repository';
@ -41,6 +41,8 @@ export class Caching {
} }
} }
public static async PushToCache(cacheFolder: string, sourceFolder: string, cacheArtifactName: string) { public static async PushToCache(cacheFolder: string, sourceFolder: string, cacheArtifactName: string) {
CloudRunnerSystem.Run(`ls ${cacheFolder}`);
CloudRunnerSystem.Run(`ls ${sourceFolder}`);
cacheArtifactName = cacheArtifactName.replace(' ', ''); cacheArtifactName = cacheArtifactName.replace(' ', '');
const startPath = process.cwd(); const startPath = process.cwd();
try { try {
@ -82,6 +84,8 @@ export class Caching {
process.chdir(`${startPath}`); process.chdir(`${startPath}`);
} }
public static async PullFromCache(cacheFolder: string, destinationFolder: string, cacheArtifactName: string = ``) { public static async PullFromCache(cacheFolder: string, destinationFolder: string, cacheArtifactName: string = ``) {
CloudRunnerSystem.Run(`ls ${cacheFolder}`);
CloudRunnerSystem.Run(`ls ${destinationFolder}`);
cacheArtifactName = cacheArtifactName.replace(' ', ''); cacheArtifactName = cacheArtifactName.replace(' ', '');
const startPath = process.cwd(); const startPath = process.cwd();
RemoteClientLogger.log(`Caching for ${path.basename(destinationFolder)}`); RemoteClientLogger.log(`Caching for ${path.basename(destinationFolder)}`);

View File

@ -2,13 +2,13 @@ import fs from 'fs';
import CloudRunner from '../cloud-runner'; import CloudRunner from '../cloud-runner';
import { CloudRunnerFolders } from '../services/cloud-runner-folders'; import { CloudRunnerFolders } from '../services/cloud-runner-folders';
import { Caching } from './caching'; import { Caching } from './caching';
import { LFSHashing } from './lfs-hashing'; import { LFSHashing } from '../services/lfs-hashing';
import { CloudRunnerSystem } from './cloud-runner-system';
import { RemoteClientLogger } from './remote-client-logger'; import { RemoteClientLogger } from './remote-client-logger';
import path from 'path'; import path from 'path';
import { assert } from 'console'; import { assert } from 'console';
import CloudRunnerLogger from '../services/cloud-runner-logger'; import CloudRunnerLogger from '../services/cloud-runner-logger';
import { CliFunction } from '../../cli/cli-functions-repository'; import { CliFunction } from '../../cli/cli-functions-repository';
import { CloudRunnerSystem } from '../services/cloud-runner-system';
export class SetupCloudRunnerRepository { export class SetupCloudRunnerRepository {
public static async run() { public static async run() {

View File

@ -1,5 +1,5 @@
import { exec } from 'child_process'; import { exec } from 'child_process';
import { RemoteClientLogger } from './remote-client-logger'; import { RemoteClientLogger } from '../remote-client/remote-client-logger';
export class CloudRunnerSystem { export class CloudRunnerSystem {
public static async Run(command: string, suppressError = false, suppressLogs = false) { public static async Run(command: string, suppressError = false, suppressLogs = false) {
for (const element of command.split(`\n`)) { for (const element of command.split(`\n`)) {

View File

@ -1,5 +1,5 @@
import { CloudRunnerSystem } from '../remote-client/cloud-runner-system';
import Input from '../../input'; import Input from '../../input';
import { CloudRunnerSystem } from './cloud-runner-system';
class DependencyOverrideService { class DependencyOverrideService {
public static async CheckHealth() { public static async CheckHealth() {

View File

@ -1,5 +1,5 @@
import path from 'path'; import path from 'path';
import { CloudRunnerFolders } from '../services/cloud-runner-folders'; import { CloudRunnerFolders } from './cloud-runner-folders';
import { CloudRunnerSystem } from './cloud-runner-system'; import { CloudRunnerSystem } from './cloud-runner-system';
import fs from 'fs'; import fs from 'fs';
import { assert } from 'console'; import { assert } from 'console';

View File

@ -1,4 +1,4 @@
import { CloudRunnerSystem } from '../cloud-runner/remote-client/cloud-runner-system'; import { CloudRunnerSystem } from '../cloud-runner/services/cloud-runner-system';
export class GenericInputReader { export class GenericInputReader {
public static async Run(command) { public static async Run(command) {

View File

@ -1,6 +1,6 @@
import { assert } from 'console'; import { assert } from 'console';
import fs from 'fs'; import fs from 'fs';
import { CloudRunnerSystem } from '../cloud-runner/remote-client/cloud-runner-system'; import { CloudRunnerSystem } from '../cloud-runner/services/cloud-runner-system';
import CloudRunnerLogger from '../cloud-runner/services/cloud-runner-logger'; import CloudRunnerLogger from '../cloud-runner/services/cloud-runner-logger';
export class GitRepoReader { export class GitRepoReader {

View File

@ -1,4 +1,4 @@
import { CloudRunnerSystem } from '../cloud-runner/remote-client/cloud-runner-system'; import { CloudRunnerSystem } from '../cloud-runner/services/cloud-runner-system';
import * as core from '@actions/core'; import * as core from '@actions/core';
export class GithubCliReader { export class GithubCliReader {