|
|
|
|
@ -343,6 +343,38 @@ class Cache {
|
|
|
|
|
exports.default = Cache;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 8731:
|
|
|
|
|
/***/ ((__unused_webpack_module, exports) => {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
|
|
exports.GetAllCliModes = exports.GetCliFunctions = exports.CliFunction = void 0;
|
|
|
|
|
const targets = new Array();
|
|
|
|
|
function CliFunction(key, description) {
|
|
|
|
|
return function (target, propertyKey, descriptor) {
|
|
|
|
|
targets.push({
|
|
|
|
|
target,
|
|
|
|
|
propertyKey,
|
|
|
|
|
descriptor,
|
|
|
|
|
key,
|
|
|
|
|
description,
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
exports.CliFunction = CliFunction;
|
|
|
|
|
function GetCliFunctions(key) {
|
|
|
|
|
return targets.find((x) => x.key === key);
|
|
|
|
|
}
|
|
|
|
|
exports.GetCliFunctions = GetCliFunctions;
|
|
|
|
|
function GetAllCliModes() {
|
|
|
|
|
return targets.map((x) => x.key);
|
|
|
|
|
}
|
|
|
|
|
exports.GetAllCliModes = GetAllCliModes;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 55651:
|
|
|
|
|
@ -362,6 +394,12 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
|
|
}) : function(o, v) {
|
|
|
|
|
o["default"] = v;
|
|
|
|
|
});
|
|
|
|
|
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 __importStar = (this && this.__importStar) || function (mod) {
|
|
|
|
|
if (mod && mod.__esModule) return mod;
|
|
|
|
|
var result = {};
|
|
|
|
|
@ -386,33 +424,21 @@ exports.CLI = void 0;
|
|
|
|
|
const commander_ts_1 = __webpack_require__(40451);
|
|
|
|
|
const __1 = __webpack_require__(41359);
|
|
|
|
|
const core = __importStar(__webpack_require__(42186));
|
|
|
|
|
const remote_client_1 = __webpack_require__(95575);
|
|
|
|
|
const action_yaml_1 = __webpack_require__(11091);
|
|
|
|
|
const cloud_runner_logger_1 = __importDefault(__webpack_require__(22855));
|
|
|
|
|
const cli_decorator_1 = __webpack_require__(8731);
|
|
|
|
|
class CLI {
|
|
|
|
|
static RunCli(options) {
|
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
|
__1.Input.githubInputEnabled = false;
|
|
|
|
|
const container = new Array();
|
|
|
|
|
container.push({
|
|
|
|
|
key: `remote-cli`,
|
|
|
|
|
asyncFunc: remote_client_1.RemoteClient.Run,
|
|
|
|
|
}, {
|
|
|
|
|
key: `cli`,
|
|
|
|
|
asyncFunc: () => __awaiter(this, void 0, void 0, function* () {
|
|
|
|
|
options.versioning = 'None';
|
|
|
|
|
__1.Input.cliOptions = options;
|
|
|
|
|
const buildParameter = yield __1.BuildParameters.create();
|
|
|
|
|
const baseImage = new __1.ImageTag(buildParameter);
|
|
|
|
|
return yield __1.CloudRunner.run(buildParameter, baseImage.toString());
|
|
|
|
|
}),
|
|
|
|
|
});
|
|
|
|
|
const results = container.filter((x) => x.key === options.mode);
|
|
|
|
|
if (results.length === 0) {
|
|
|
|
|
const results = cli_decorator_1.GetCliFunctions(options.mode);
|
|
|
|
|
if (results === undefined || results.length === 0) {
|
|
|
|
|
throw new Error('no CLI mode found');
|
|
|
|
|
}
|
|
|
|
|
cloud_runner_logger_1.default.log(`Entrypoint: ${results[0].key}`);
|
|
|
|
|
return yield results[0].asyncFunc();
|
|
|
|
|
cloud_runner_logger_1.default.log(`Entrypoint: ${results.key}`);
|
|
|
|
|
options.versioning = 'None';
|
|
|
|
|
__1.Input.cliOptions = options;
|
|
|
|
|
return yield results.target[results.propertyKey]();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
static isCliMode(options) {
|
|
|
|
|
@ -432,402 +458,26 @@ class CLI {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
core.info(`\n`);
|
|
|
|
|
program.option('-m, --mode <mode>', 'cli or default');
|
|
|
|
|
program.option('-m, --mode <mode>', cli_decorator_1.GetAllCliModes()
|
|
|
|
|
.map((x) => `${x.key} (${x.description})`)
|
|
|
|
|
.join(` | `));
|
|
|
|
|
program.parse(process.argv);
|
|
|
|
|
return program.opts();
|
|
|
|
|
}
|
|
|
|
|
static CLIBuild() {
|
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
|
const buildParameter = yield __1.BuildParameters.create();
|
|
|
|
|
const baseImage = new __1.ImageTag(buildParameter);
|
|
|
|
|
return yield __1.CloudRunner.run(buildParameter, baseImage.toString());
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
__decorate([
|
|
|
|
|
cli_decorator_1.CliFunction(`cli`, `runs a cloud runner build`)
|
|
|
|
|
], CLI, "CLIBuild", null);
|
|
|
|
|
exports.CLI = CLI;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 35010:
|
|
|
|
|
/***/ (function(__unused_webpack_module, exports, __webpack_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());
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
|
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
|
|
|
};
|
|
|
|
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
|
|
exports.Caching = void 0;
|
|
|
|
|
const console_1 = __webpack_require__(57082);
|
|
|
|
|
const fs_1 = __importDefault(__webpack_require__(35747));
|
|
|
|
|
const path_1 = __importDefault(__webpack_require__(85622));
|
|
|
|
|
const __1 = __webpack_require__(41359);
|
|
|
|
|
const cloud_runner_state_1 = __webpack_require__(70912);
|
|
|
|
|
const cloud_runner_agent_system_1 = __webpack_require__(87685);
|
|
|
|
|
const remote_client_logger_1 = __webpack_require__(68972);
|
|
|
|
|
class Caching {
|
|
|
|
|
static PushToCache(cacheFolder, sourceFolder, cacheKey) {
|
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
|
try {
|
|
|
|
|
if (__1.Input.cloudRunnerTests) {
|
|
|
|
|
yield Caching.printFullCacheHierarchySize();
|
|
|
|
|
}
|
|
|
|
|
process.chdir(`${sourceFolder}/..`);
|
|
|
|
|
if (__1.Input.cloudRunnerTests) {
|
|
|
|
|
yield cloud_runner_agent_system_1.CloudRunnerAgentSystem.Run(`tree ${sourceFolder}`);
|
|
|
|
|
yield cloud_runner_agent_system_1.CloudRunnerAgentSystem.Run(`tree ${cacheFolder}`);
|
|
|
|
|
}
|
|
|
|
|
yield cloud_runner_agent_system_1.CloudRunnerAgentSystem.Run(`zip -r "${cacheKey}.zip" "${path_1.default.dirname(sourceFolder)}"`);
|
|
|
|
|
console_1.assert(fs_1.default.existsSync(`${cacheKey}.zip`));
|
|
|
|
|
yield cloud_runner_agent_system_1.CloudRunnerAgentSystem.Run(`cp "${cacheKey}.zip" "${path_1.default.join(cacheFolder, `${cacheKey}.zip`)}"`);
|
|
|
|
|
remote_client_logger_1.RemoteClientLogger.log(`copied ${cacheKey} to ${cacheFolder}`);
|
|
|
|
|
if (__1.Input.cloudRunnerTests) {
|
|
|
|
|
yield cloud_runner_agent_system_1.CloudRunnerAgentSystem.Run(`tree ${cacheFolder}`);
|
|
|
|
|
}
|
|
|
|
|
if (__1.Input.cloudRunnerTests) {
|
|
|
|
|
yield Caching.printFullCacheHierarchySize();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (error) {
|
|
|
|
|
throw error;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
static PullFromCache(cacheFolder, destinationFolder, cacheKey = ``) {
|
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
|
remote_client_logger_1.RemoteClientLogger.log(`Caching for ${path_1.default.dirname(destinationFolder)}`);
|
|
|
|
|
try {
|
|
|
|
|
if (!fs_1.default.existsSync(cacheFolder)) {
|
|
|
|
|
yield cloud_runner_agent_system_1.CloudRunnerAgentSystem.Run(`mkdir -p ${cacheFolder}`);
|
|
|
|
|
}
|
|
|
|
|
if (!fs_1.default.existsSync(destinationFolder)) {
|
|
|
|
|
yield cloud_runner_agent_system_1.CloudRunnerAgentSystem.Run(`mkdir -p ${destinationFolder}`);
|
|
|
|
|
}
|
|
|
|
|
const latest = yield (yield cloud_runner_agent_system_1.CloudRunnerAgentSystem.Run(`ls -t "${cacheFolder}" | grep .zip$ | head -1`)).replace(/\n/g, ``);
|
|
|
|
|
process.chdir(cacheFolder);
|
|
|
|
|
let cacheSelection;
|
|
|
|
|
if (__1.Input.cloudRunnerTests) {
|
|
|
|
|
yield cloud_runner_agent_system_1.CloudRunnerAgentSystem.Run(`tree ${cacheFolder}`);
|
|
|
|
|
}
|
|
|
|
|
if (cacheKey !== ``) {
|
|
|
|
|
cacheSelection = fs_1.default.existsSync(cacheKey) ? cacheKey : latest;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
cacheSelection = latest;
|
|
|
|
|
}
|
|
|
|
|
if (fs_1.default.existsSync(cacheSelection)) {
|
|
|
|
|
if (__1.Input.cloudRunnerTests) {
|
|
|
|
|
yield cloud_runner_agent_system_1.CloudRunnerAgentSystem.Run(`tree ${destinationFolder}`);
|
|
|
|
|
}
|
|
|
|
|
remote_client_logger_1.RemoteClientLogger.log(`cache item exists`);
|
|
|
|
|
console_1.assert(fs_1.default.existsSync(destinationFolder));
|
|
|
|
|
yield cloud_runner_agent_system_1.CloudRunnerAgentSystem.Run(`unzip "${cacheSelection}" -d "${destinationFolder}/.."`);
|
|
|
|
|
if (__1.Input.cloudRunnerTests) {
|
|
|
|
|
yield cloud_runner_agent_system_1.CloudRunnerAgentSystem.Run(`tree ${destinationFolder}`);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
remote_client_logger_1.RemoteClientLogger.logWarning(`cache item ${cacheKey} doesn't exist ${destinationFolder}`);
|
|
|
|
|
if (cacheSelection !== ``) {
|
|
|
|
|
throw new Error(`Failed to get cache item, but cache hit was found: ${cacheSelection}`);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (error) {
|
|
|
|
|
throw error;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
static handleCachePurging() {
|
|
|
|
|
if (process.env.purgeRemoteCaching !== undefined) {
|
|
|
|
|
remote_client_logger_1.RemoteClientLogger.log(`purging ${cloud_runner_state_1.CloudRunnerState.purgeRemoteCaching}`);
|
|
|
|
|
fs_1.default.rmdirSync(cloud_runner_state_1.CloudRunnerState.cacheFolder, { recursive: true });
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
static printFullCacheHierarchySize() {
|
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
|
yield cloud_runner_agent_system_1.CloudRunnerAgentSystem.Run(`echo ' '
|
|
|
|
|
echo "LFS cache for $branch"
|
|
|
|
|
du -sch "${cloud_runner_state_1.CloudRunnerState.lfsCacheFolderFull}/"
|
|
|
|
|
echo '**'
|
|
|
|
|
echo "Library cache for $branch"
|
|
|
|
|
du -sch "${cloud_runner_state_1.CloudRunnerState.libraryCacheFolderFull}/"
|
|
|
|
|
echo '**'
|
|
|
|
|
echo "Branch: $branch"
|
|
|
|
|
du -sch "${cloud_runner_state_1.CloudRunnerState.cacheFolderFull}/"
|
|
|
|
|
echo '**'
|
|
|
|
|
echo 'Full cache'
|
|
|
|
|
du -sch "${cloud_runner_state_1.CloudRunnerState.cacheFolderFull}/.."
|
|
|
|
|
echo ' '`);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
exports.Caching = Caching;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 87685:
|
|
|
|
|
/***/ (function(__unused_webpack_module, exports, __webpack_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.CloudRunnerAgentSystem = void 0;
|
|
|
|
|
const child_process_1 = __webpack_require__(63129);
|
|
|
|
|
const remote_client_logger_1 = __webpack_require__(68972);
|
|
|
|
|
class CloudRunnerAgentSystem {
|
|
|
|
|
static Run(command) {
|
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
|
remote_client_logger_1.RemoteClientLogger.log(`${command}`);
|
|
|
|
|
return yield new Promise((promise) => {
|
|
|
|
|
let output = '';
|
|
|
|
|
const child = child_process_1.exec(command, (error, stdout, stderr) => {
|
|
|
|
|
if (error) {
|
|
|
|
|
remote_client_logger_1.RemoteClientLogger.logCliError(`${error.message}`);
|
|
|
|
|
throw new Error(error.toString());
|
|
|
|
|
}
|
|
|
|
|
if (stderr) {
|
|
|
|
|
remote_client_logger_1.RemoteClientLogger.logCliDiagnostic(`${stderr.toString()}`);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
const outputChunk = `${stdout}`;
|
|
|
|
|
output += outputChunk;
|
|
|
|
|
});
|
|
|
|
|
child.on('close', function (code) {
|
|
|
|
|
remote_client_logger_1.RemoteClientLogger.log(`[Exit code ${code}]`);
|
|
|
|
|
if (code !== 0) {
|
|
|
|
|
throw new Error(output);
|
|
|
|
|
}
|
|
|
|
|
const outputLines = output.split(`\n`);
|
|
|
|
|
for (const element of outputLines) {
|
|
|
|
|
remote_client_logger_1.RemoteClientLogger.log(element);
|
|
|
|
|
}
|
|
|
|
|
promise(output);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
exports.CloudRunnerAgentSystem = CloudRunnerAgentSystem;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 95575:
|
|
|
|
|
/***/ (function(__unused_webpack_module, exports, __webpack_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.RemoteClient = void 0;
|
|
|
|
|
const cloud_runner_state_1 = __webpack_require__(70912);
|
|
|
|
|
const remote_client_logger_1 = __webpack_require__(68972);
|
|
|
|
|
const setup_cloud_runner_repository_1 = __webpack_require__(39656);
|
|
|
|
|
class RemoteClient {
|
|
|
|
|
static Run() {
|
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
|
const buildParameter = JSON.parse(process.env.BUILD_PARAMETERS || '{}');
|
|
|
|
|
remote_client_logger_1.RemoteClientLogger.log(`Build Params:
|
|
|
|
|
${JSON.stringify(buildParameter, undefined, 4)}
|
|
|
|
|
`);
|
|
|
|
|
cloud_runner_state_1.CloudRunnerState.setup(buildParameter);
|
|
|
|
|
yield setup_cloud_runner_repository_1.SetupCloudRunnerRepository.run();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
exports.RemoteClient = RemoteClient;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 47011:
|
|
|
|
|
/***/ (function(__unused_webpack_module, exports, __webpack_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());
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
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(__webpack_require__(85622));
|
|
|
|
|
const cloud_runner_state_1 = __webpack_require__(70912);
|
|
|
|
|
const cloud_runner_agent_system_1 = __webpack_require__(87685);
|
|
|
|
|
const fs_1 = __importDefault(__webpack_require__(35747));
|
|
|
|
|
const console_1 = __webpack_require__(57082);
|
|
|
|
|
const __1 = __webpack_require__(41359);
|
|
|
|
|
const remote_client_logger_1 = __webpack_require__(68972);
|
|
|
|
|
class LFSHashing {
|
|
|
|
|
static createLFSHashFiles() {
|
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
|
try {
|
|
|
|
|
yield cloud_runner_agent_system_1.CloudRunnerAgentSystem.Run(`git lfs ls-files -l | cut -d ' ' -f1 | sort > .lfs-assets-guid`);
|
|
|
|
|
yield cloud_runner_agent_system_1.CloudRunnerAgentSystem.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_state_1.CloudRunnerState.repoPathFull, `.lfs-assets-guid`)}`, 'utf8'),
|
|
|
|
|
lfsGuidSum: fs_1.default.readFileSync(`${path_1.default.join(cloud_runner_state_1.CloudRunnerState.repoPathFull, `.lfs-assets-guid-sum`)}`, 'utf8'),
|
|
|
|
|
};
|
|
|
|
|
if (__1.Input.cloudRunnerTests) {
|
|
|
|
|
remote_client_logger_1.RemoteClientLogger.log(lfsHashes.lfsGuid);
|
|
|
|
|
remote_client_logger_1.RemoteClientLogger.log(lfsHashes.lfsGuidSum);
|
|
|
|
|
}
|
|
|
|
|
return lfsHashes;
|
|
|
|
|
}
|
|
|
|
|
catch (error) {
|
|
|
|
|
throw error;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
exports.LFSHashing = LFSHashing;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 68972:
|
|
|
|
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
|
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
|
|
|
};
|
|
|
|
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
|
|
exports.RemoteClientLogger = void 0;
|
|
|
|
|
const cloud_runner_logger_1 = __importDefault(__webpack_require__(22855));
|
|
|
|
|
class RemoteClientLogger {
|
|
|
|
|
static log(message) {
|
|
|
|
|
cloud_runner_logger_1.default.log(`[Client] ${message}`);
|
|
|
|
|
}
|
|
|
|
|
static logCliError(message) {
|
|
|
|
|
cloud_runner_logger_1.default.log(`[Client][Error] ${message}`);
|
|
|
|
|
}
|
|
|
|
|
static logCliDiagnostic(message) {
|
|
|
|
|
cloud_runner_logger_1.default.log(`[Client][Diagnostic] ${message}`);
|
|
|
|
|
}
|
|
|
|
|
static logWarning(message) {
|
|
|
|
|
cloud_runner_logger_1.default.logWarning(message);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
exports.RemoteClientLogger = RemoteClientLogger;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 39656:
|
|
|
|
|
/***/ (function(__unused_webpack_module, exports, __webpack_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());
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
|
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
|
|
|
};
|
|
|
|
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
|
|
exports.SetupCloudRunnerRepository = void 0;
|
|
|
|
|
const fs_1 = __importDefault(__webpack_require__(35747));
|
|
|
|
|
const cloud_runner_state_1 = __webpack_require__(70912);
|
|
|
|
|
const caching_1 = __webpack_require__(35010);
|
|
|
|
|
const lfs_hashing_1 = __webpack_require__(47011);
|
|
|
|
|
const cloud_runner_agent_system_1 = __webpack_require__(87685);
|
|
|
|
|
const __1 = __webpack_require__(41359);
|
|
|
|
|
const remote_client_logger_1 = __webpack_require__(68972);
|
|
|
|
|
class SetupCloudRunnerRepository {
|
|
|
|
|
static run() {
|
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
|
try {
|
|
|
|
|
yield cloud_runner_agent_system_1.CloudRunnerAgentSystem.Run(`mkdir -p ${cloud_runner_state_1.CloudRunnerState.buildPathFull}`);
|
|
|
|
|
yield cloud_runner_agent_system_1.CloudRunnerAgentSystem.Run(`mkdir -p ${cloud_runner_state_1.CloudRunnerState.repoPathFull}`);
|
|
|
|
|
yield SetupCloudRunnerRepository.cloneRepoWithoutLFSFiles();
|
|
|
|
|
const lfsHashes = yield lfs_hashing_1.LFSHashing.createLFSHashFiles();
|
|
|
|
|
if (!fs_1.default.existsSync(cloud_runner_state_1.CloudRunnerState.libraryFolderFull)) {
|
|
|
|
|
remote_client_logger_1.RemoteClientLogger.logWarning(`!Warning!: The Unity library was included in the git repository`);
|
|
|
|
|
}
|
|
|
|
|
yield caching_1.Caching.PullFromCache(cloud_runner_state_1.CloudRunnerState.lfsCacheFolderFull, cloud_runner_state_1.CloudRunnerState.lfsDirectory, `${lfsHashes.lfsGuid}.zip`);
|
|
|
|
|
yield SetupCloudRunnerRepository.pullLatestLFS();
|
|
|
|
|
yield caching_1.Caching.PushToCache(cloud_runner_state_1.CloudRunnerState.lfsCacheFolderFull, cloud_runner_state_1.CloudRunnerState.lfsDirectory, lfsHashes.lfsGuid);
|
|
|
|
|
yield caching_1.Caching.PullFromCache(cloud_runner_state_1.CloudRunnerState.libraryCacheFolderFull, cloud_runner_state_1.CloudRunnerState.libraryFolderFull);
|
|
|
|
|
caching_1.Caching.handleCachePurging();
|
|
|
|
|
}
|
|
|
|
|
catch (error) {
|
|
|
|
|
throw error;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
static cloneRepoWithoutLFSFiles() {
|
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
|
try {
|
|
|
|
|
remote_client_logger_1.RemoteClientLogger.log(`Initializing source repository for cloning with caching of LFS files`);
|
|
|
|
|
process.chdir(cloud_runner_state_1.CloudRunnerState.repoPathFull);
|
|
|
|
|
yield cloud_runner_agent_system_1.CloudRunnerAgentSystem.Run(`git config --global advice.detachedHead false`);
|
|
|
|
|
remote_client_logger_1.RemoteClientLogger.log(`Cloning the repository being built:`);
|
|
|
|
|
yield cloud_runner_agent_system_1.CloudRunnerAgentSystem.Run(`git lfs install --skip-smudge`);
|
|
|
|
|
yield cloud_runner_agent_system_1.CloudRunnerAgentSystem.Run(`git clone ${cloud_runner_state_1.CloudRunnerState.targetBuildRepoUrl} ${cloud_runner_state_1.CloudRunnerState.repoPathFull}`);
|
|
|
|
|
if (__1.Input.cloudRunnerTests) {
|
|
|
|
|
yield cloud_runner_agent_system_1.CloudRunnerAgentSystem.Run(`ls -lh`);
|
|
|
|
|
yield cloud_runner_agent_system_1.CloudRunnerAgentSystem.Run(`tree`);
|
|
|
|
|
}
|
|
|
|
|
remote_client_logger_1.RemoteClientLogger.log(`${cloud_runner_state_1.CloudRunnerState.buildParams.branch}`);
|
|
|
|
|
yield cloud_runner_agent_system_1.CloudRunnerAgentSystem.Run(`git checkout ${cloud_runner_state_1.CloudRunnerState.buildParams.branch}`);
|
|
|
|
|
remote_client_logger_1.RemoteClientLogger.log(`Checked out ${process.env.GITHUB_SHA}`);
|
|
|
|
|
}
|
|
|
|
|
catch (error) {
|
|
|
|
|
throw error;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
static pullLatestLFS() {
|
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
|
process.chdir(cloud_runner_state_1.CloudRunnerState.repoPathFull);
|
|
|
|
|
yield cloud_runner_agent_system_1.CloudRunnerAgentSystem.Run(`git lfs pull`);
|
|
|
|
|
remote_client_logger_1.RemoteClientLogger.log(`pulled latest LFS files`);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
exports.SetupCloudRunnerRepository = SetupCloudRunnerRepository;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 28730:
|
|
|
|
|
@ -2852,16 +2502,16 @@ class SetupStep {
|
|
|
|
|
try {
|
|
|
|
|
cloud_runner_logger_1.default.log(` `);
|
|
|
|
|
cloud_runner_logger_1.default.logLine('Starting step 1/2 (setup game files from repository)');
|
|
|
|
|
return yield cloud_runner_state_1.CloudRunnerState.CloudRunnerProviderPlatform.runTask(cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid, image, `
|
|
|
|
|
apk update -q
|
|
|
|
|
apk add unzip zip git-lfs jq tree nodejs -q
|
|
|
|
|
${__1.Input.cloudRunnerTests ? '' : '#'} apk add tree -q
|
|
|
|
|
export GIT_DISCOVERY_ACROSS_FILESYSTEM=1
|
|
|
|
|
mkdir -p ${cloud_runner_state_1.CloudRunnerState.builderPathFull.replace(/\\/g, `/`)}
|
|
|
|
|
git clone -b ${cloud_runner_state_1.CloudRunnerState.branchName} ${cloud_runner_state_1.CloudRunnerState.unityBuilderRepoUrl} "${cloud_runner_state_1.CloudRunnerState.builderPathFull.replace(/\\/g, `/`)}"
|
|
|
|
|
${__1.Input.cloudRunnerTests ? '' : '#'} tree ${cloud_runner_state_1.CloudRunnerState.builderPathFull.replace(/\\/g, `/`)}
|
|
|
|
|
chmod +x ${path_1.default.join(cloud_runner_state_1.CloudRunnerState.builderPathFull, 'dist', `index.js`).replace(/\\/g, `/`)}
|
|
|
|
|
node ${path_1.default.join(cloud_runner_state_1.CloudRunnerState.builderPathFull, 'dist', `index.js`).replace(/\\/g, `/`)} -m remote-cli
|
|
|
|
|
return yield cloud_runner_state_1.CloudRunnerState.CloudRunnerProviderPlatform.runTask(cloud_runner_state_1.CloudRunnerState.buildParams.buildGuid, image, `
|
|
|
|
|
apk update -q
|
|
|
|
|
apk add unzip zip git-lfs jq tree nodejs -q
|
|
|
|
|
${__1.Input.cloudRunnerTests ? '' : '#'} apk add tree -q
|
|
|
|
|
export GIT_DISCOVERY_ACROSS_FILESYSTEM=1
|
|
|
|
|
mkdir -p ${cloud_runner_state_1.CloudRunnerState.builderPathFull.replace(/\\/g, `/`)}
|
|
|
|
|
git clone -b ${cloud_runner_state_1.CloudRunnerState.branchName} ${cloud_runner_state_1.CloudRunnerState.unityBuilderRepoUrl} "${cloud_runner_state_1.CloudRunnerState.builderPathFull.replace(/\\/g, `/`)}"
|
|
|
|
|
${__1.Input.cloudRunnerTests ? '' : '#'} tree ${cloud_runner_state_1.CloudRunnerState.builderPathFull.replace(/\\/g, `/`)}
|
|
|
|
|
chmod +x ${path_1.default.join(cloud_runner_state_1.CloudRunnerState.builderPathFull, 'dist', `index.js`).replace(/\\/g, `/`)}
|
|
|
|
|
node ${path_1.default.join(cloud_runner_state_1.CloudRunnerState.builderPathFull, 'dist', `index.js`).replace(/\\/g, `/`)} -m remote-cli
|
|
|
|
|
`, `/${cloud_runner_state_1.CloudRunnerState.buildVolumeFolder}`, `/${cloud_runner_state_1.CloudRunnerState.buildVolumeFolder}/`, environmentVariables, secrets);
|
|
|
|
|
}
|
|
|
|
|
catch (error) {
|
|
|
|
|
|