|
|
|
|
@ -895,7 +895,7 @@ const task_parameter_serializer_1 = __nccwpck_require__(35346);
|
|
|
|
|
const core = __importStar(__nccwpck_require__(42186));
|
|
|
|
|
const test_1 = __importDefault(__nccwpck_require__(63007));
|
|
|
|
|
const local_1 = __importDefault(__nccwpck_require__(66575));
|
|
|
|
|
const local_docker_1 = __importDefault(__nccwpck_require__(55723));
|
|
|
|
|
const docker_1 = __importDefault(__nccwpck_require__(42802));
|
|
|
|
|
const github_1 = __importDefault(__nccwpck_require__(83654));
|
|
|
|
|
const shared_workspace_locking_1 = __importDefault(__nccwpck_require__(87562));
|
|
|
|
|
class CloudRunner {
|
|
|
|
|
@ -930,7 +930,7 @@ class CloudRunner {
|
|
|
|
|
CloudRunner.Provider = new test_1.default();
|
|
|
|
|
break;
|
|
|
|
|
case 'local-docker':
|
|
|
|
|
CloudRunner.Provider = new local_docker_1.default();
|
|
|
|
|
CloudRunner.Provider = new docker_1.default();
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
CloudRunner.Provider = new local_1.default();
|
|
|
|
|
@ -2420,7 +2420,13 @@ class AWSBuildEnvironment {
|
|
|
|
|
// eslint-disable-next-line no-unused-vars
|
|
|
|
|
filter,
|
|
|
|
|
// eslint-disable-next-line no-unused-vars
|
|
|
|
|
previewOnly) {
|
|
|
|
|
previewOnly,
|
|
|
|
|
// eslint-disable-next-line no-unused-vars
|
|
|
|
|
olderThan,
|
|
|
|
|
// eslint-disable-next-line no-unused-vars
|
|
|
|
|
fullCache,
|
|
|
|
|
// eslint-disable-next-line no-unused-vars
|
|
|
|
|
baseDependencies) {
|
|
|
|
|
throw new Error('Method not implemented.');
|
|
|
|
|
}
|
|
|
|
|
listResources() {
|
|
|
|
|
@ -2798,6 +2804,129 @@ class TertiaryResourcesService {
|
|
|
|
|
exports.TertiaryResourcesService = TertiaryResourcesService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 42802:
|
|
|
|
|
/***/ (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());
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
|
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
|
|
|
};
|
|
|
|
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
|
|
const cloud_runner_logger_1 = __importDefault(__nccwpck_require__(22855));
|
|
|
|
|
const docker_1 = __importDefault(__nccwpck_require__(16934));
|
|
|
|
|
const __1 = __nccwpck_require__(41359);
|
|
|
|
|
const fs_1 = __nccwpck_require__(57147);
|
|
|
|
|
const cloud_runner_1 = __importDefault(__nccwpck_require__(79144));
|
|
|
|
|
class LocalDockerCloudRunner {
|
|
|
|
|
inspect() {
|
|
|
|
|
throw new Error('Method not implemented.');
|
|
|
|
|
}
|
|
|
|
|
watch() {
|
|
|
|
|
throw new Error('Method not implemented.');
|
|
|
|
|
}
|
|
|
|
|
listResources() {
|
|
|
|
|
throw new Error('Method not implemented.');
|
|
|
|
|
}
|
|
|
|
|
garbageCollect(
|
|
|
|
|
// eslint-disable-next-line no-unused-vars
|
|
|
|
|
filter,
|
|
|
|
|
// eslint-disable-next-line no-unused-vars
|
|
|
|
|
previewOnly,
|
|
|
|
|
// eslint-disable-next-line no-unused-vars
|
|
|
|
|
olderThan,
|
|
|
|
|
// eslint-disable-next-line no-unused-vars
|
|
|
|
|
fullCache,
|
|
|
|
|
// eslint-disable-next-line no-unused-vars
|
|
|
|
|
baseDependencies) {
|
|
|
|
|
throw new Error('Method not implemented.');
|
|
|
|
|
}
|
|
|
|
|
cleanup(
|
|
|
|
|
// eslint-disable-next-line no-unused-vars
|
|
|
|
|
buildGuid,
|
|
|
|
|
// eslint-disable-next-line no-unused-vars
|
|
|
|
|
buildParameters,
|
|
|
|
|
// eslint-disable-next-line no-unused-vars
|
|
|
|
|
branchName,
|
|
|
|
|
// eslint-disable-next-line no-unused-vars
|
|
|
|
|
defaultSecretsArray) { }
|
|
|
|
|
setup(buildGuid, buildParameters,
|
|
|
|
|
// eslint-disable-next-line no-unused-vars
|
|
|
|
|
branchName,
|
|
|
|
|
// eslint-disable-next-line no-unused-vars
|
|
|
|
|
defaultSecretsArray) {
|
|
|
|
|
this.buildParameters = buildParameters;
|
|
|
|
|
}
|
|
|
|
|
runTask(buildGuid, image, commands, mountdir, workingdir, environment, secrets) {
|
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
|
cloud_runner_logger_1.default.log(buildGuid);
|
|
|
|
|
cloud_runner_logger_1.default.log(commands);
|
|
|
|
|
const { workspace, actionFolder } = __1.Action;
|
|
|
|
|
const content = [];
|
|
|
|
|
for (const x of secrets) {
|
|
|
|
|
content.push({ name: x.EnvironmentVariable, value: x.ParameterValue });
|
|
|
|
|
}
|
|
|
|
|
for (const x of environment) {
|
|
|
|
|
content.push({ name: x.name, value: x.value });
|
|
|
|
|
}
|
|
|
|
|
// if (this.buildParameters?.cloudRunnerIntegrationTests) {
|
|
|
|
|
// core.info(JSON.stringify(content, undefined, 4));
|
|
|
|
|
// core.info(JSON.stringify(secrets, undefined, 4));
|
|
|
|
|
// core.info(JSON.stringify(environment, undefined, 4));
|
|
|
|
|
// }
|
|
|
|
|
// eslint-disable-next-line unicorn/no-for-loop
|
|
|
|
|
for (let index = 0; index < content.length; index++) {
|
|
|
|
|
if (content[index] === undefined) {
|
|
|
|
|
delete content[index];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
let myOutput = '';
|
|
|
|
|
const sharedFolder = `/data/`;
|
|
|
|
|
// core.info(JSON.stringify({ workspace, actionFolder, ...this.buildParameters, ...content }, undefined, 4));
|
|
|
|
|
const entrypointFilePath = `start.sh`;
|
|
|
|
|
const fileContents = `#!/bin/bash
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
|
|
mkdir -p /github/workspace/cloud-runner-cache
|
|
|
|
|
mkdir -p /data/cache
|
|
|
|
|
cp -a /github/workspace/cloud-runner-cache/. ${sharedFolder}
|
|
|
|
|
${commands}
|
|
|
|
|
cp -a ${sharedFolder}. /github/workspace/cloud-runner-cache/
|
|
|
|
|
`;
|
|
|
|
|
fs_1.writeFileSync(`${workspace}/${entrypointFilePath}`, fileContents, {
|
|
|
|
|
flag: 'w',
|
|
|
|
|
});
|
|
|
|
|
if (cloud_runner_1.default.buildParameters.cloudRunnerDebug) {
|
|
|
|
|
cloud_runner_logger_1.default.log(`Running local-docker: \n ${fileContents}`);
|
|
|
|
|
}
|
|
|
|
|
yield docker_1.default.run(image, Object.assign({ workspace, actionFolder }, this.buildParameters), false, `chmod +x /github/workspace/${entrypointFilePath} && /github/workspace/${entrypointFilePath}`, content, {
|
|
|
|
|
listeners: {
|
|
|
|
|
stdout: (data) => {
|
|
|
|
|
myOutput += data.toString();
|
|
|
|
|
},
|
|
|
|
|
stderr: (data) => {
|
|
|
|
|
myOutput += `[LOCAL-DOCKER-ERROR]${data.toString()}`;
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}, true);
|
|
|
|
|
return myOutput;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
exports["default"] = LocalDockerCloudRunner;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 21613:
|
|
|
|
|
@ -2878,7 +3007,13 @@ class Kubernetes {
|
|
|
|
|
// eslint-disable-next-line no-unused-vars
|
|
|
|
|
filter,
|
|
|
|
|
// eslint-disable-next-line no-unused-vars
|
|
|
|
|
previewOnly) {
|
|
|
|
|
previewOnly,
|
|
|
|
|
// eslint-disable-next-line no-unused-vars
|
|
|
|
|
olderThan,
|
|
|
|
|
// eslint-disable-next-line no-unused-vars
|
|
|
|
|
fullCache,
|
|
|
|
|
// eslint-disable-next-line no-unused-vars
|
|
|
|
|
baseDependencies) {
|
|
|
|
|
throw new Error('Method not implemented.');
|
|
|
|
|
}
|
|
|
|
|
setup(buildGuid, buildParameters,
|
|
|
|
|
@ -3562,123 +3697,6 @@ class KubernetesTaskRunner {
|
|
|
|
|
exports["default"] = KubernetesTaskRunner;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 55723:
|
|
|
|
|
/***/ (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());
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
|
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
|
|
|
};
|
|
|
|
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
|
|
const cloud_runner_logger_1 = __importDefault(__nccwpck_require__(22855));
|
|
|
|
|
const docker_1 = __importDefault(__nccwpck_require__(16934));
|
|
|
|
|
const model_1 = __nccwpck_require__(41359);
|
|
|
|
|
const fs_1 = __nccwpck_require__(57147);
|
|
|
|
|
const cloud_runner_1 = __importDefault(__nccwpck_require__(79144));
|
|
|
|
|
class LocalDockerCloudRunner {
|
|
|
|
|
inspect() {
|
|
|
|
|
throw new Error('Method not implemented.');
|
|
|
|
|
}
|
|
|
|
|
watch() {
|
|
|
|
|
throw new Error('Method not implemented.');
|
|
|
|
|
}
|
|
|
|
|
listResources() {
|
|
|
|
|
throw new Error('Method not implemented.');
|
|
|
|
|
}
|
|
|
|
|
garbageCollect(
|
|
|
|
|
// eslint-disable-next-line no-unused-vars
|
|
|
|
|
filter,
|
|
|
|
|
// eslint-disable-next-line no-unused-vars
|
|
|
|
|
previewOnly) {
|
|
|
|
|
throw new Error('Method not implemented.');
|
|
|
|
|
}
|
|
|
|
|
cleanup(
|
|
|
|
|
// eslint-disable-next-line no-unused-vars
|
|
|
|
|
buildGuid,
|
|
|
|
|
// eslint-disable-next-line no-unused-vars
|
|
|
|
|
buildParameters,
|
|
|
|
|
// eslint-disable-next-line no-unused-vars
|
|
|
|
|
branchName,
|
|
|
|
|
// eslint-disable-next-line no-unused-vars
|
|
|
|
|
defaultSecretsArray) { }
|
|
|
|
|
setup(buildGuid, buildParameters,
|
|
|
|
|
// eslint-disable-next-line no-unused-vars
|
|
|
|
|
branchName,
|
|
|
|
|
// eslint-disable-next-line no-unused-vars
|
|
|
|
|
defaultSecretsArray) {
|
|
|
|
|
this.buildParameters = buildParameters;
|
|
|
|
|
}
|
|
|
|
|
runTask(buildGuid, image, commands, mountdir, workingdir, environment, secrets) {
|
|
|
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
|
|
|
cloud_runner_logger_1.default.log(buildGuid);
|
|
|
|
|
cloud_runner_logger_1.default.log(commands);
|
|
|
|
|
const { workspace, actionFolder } = model_1.Action;
|
|
|
|
|
const content = [];
|
|
|
|
|
for (const x of secrets) {
|
|
|
|
|
content.push({ name: x.EnvironmentVariable, value: x.ParameterValue });
|
|
|
|
|
}
|
|
|
|
|
for (const x of environment) {
|
|
|
|
|
content.push({ name: x.name, value: x.value });
|
|
|
|
|
}
|
|
|
|
|
// if (this.buildParameters?.cloudRunnerIntegrationTests) {
|
|
|
|
|
// core.info(JSON.stringify(content, undefined, 4));
|
|
|
|
|
// core.info(JSON.stringify(secrets, undefined, 4));
|
|
|
|
|
// core.info(JSON.stringify(environment, undefined, 4));
|
|
|
|
|
// }
|
|
|
|
|
// eslint-disable-next-line unicorn/no-for-loop
|
|
|
|
|
for (let index = 0; index < content.length; index++) {
|
|
|
|
|
if (content[index] === undefined) {
|
|
|
|
|
delete content[index];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
let myOutput = '';
|
|
|
|
|
const sharedFolder = `/data/`;
|
|
|
|
|
// core.info(JSON.stringify({ workspace, actionFolder, ...this.buildParameters, ...content }, undefined, 4));
|
|
|
|
|
const entrypointFilePath = `start.sh`;
|
|
|
|
|
const fileContents = `#!/bin/bash
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
|
|
mkdir -p /github/workspace/cloud-runner-cache
|
|
|
|
|
mkdir -p /data/cache
|
|
|
|
|
cp -a /github/workspace/cloud-runner-cache/. ${sharedFolder}
|
|
|
|
|
${commands}
|
|
|
|
|
cp -a ${sharedFolder}. /github/workspace/cloud-runner-cache/
|
|
|
|
|
`;
|
|
|
|
|
fs_1.writeFileSync(`${workspace}/${entrypointFilePath}`, fileContents, {
|
|
|
|
|
flag: 'w',
|
|
|
|
|
});
|
|
|
|
|
if (cloud_runner_1.default.buildParameters.cloudRunnerDebug) {
|
|
|
|
|
cloud_runner_logger_1.default.log(`Running local-docker: \n ${fileContents}`);
|
|
|
|
|
}
|
|
|
|
|
yield docker_1.default.run(image, Object.assign({ workspace, actionFolder }, this.buildParameters), false, `chmod +x /github/workspace/${entrypointFilePath} && /github/workspace/${entrypointFilePath}`, content, {
|
|
|
|
|
listeners: {
|
|
|
|
|
stdout: (data) => {
|
|
|
|
|
myOutput += data.toString();
|
|
|
|
|
},
|
|
|
|
|
stderr: (data) => {
|
|
|
|
|
myOutput += `[LOCAL-DOCKER-ERROR]${data.toString()}`;
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}, true);
|
|
|
|
|
return myOutput;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
exports["default"] = LocalDockerCloudRunner;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ 66575:
|
|
|
|
|
@ -3715,7 +3733,13 @@ class LocalCloudRunner {
|
|
|
|
|
// eslint-disable-next-line no-unused-vars
|
|
|
|
|
filter,
|
|
|
|
|
// eslint-disable-next-line no-unused-vars
|
|
|
|
|
previewOnly) {
|
|
|
|
|
previewOnly,
|
|
|
|
|
// eslint-disable-next-line no-unused-vars
|
|
|
|
|
olderThan,
|
|
|
|
|
// eslint-disable-next-line no-unused-vars
|
|
|
|
|
fullCache,
|
|
|
|
|
// eslint-disable-next-line no-unused-vars
|
|
|
|
|
baseDependencies) {
|
|
|
|
|
throw new Error('Method not implemented.');
|
|
|
|
|
}
|
|
|
|
|
cleanup(
|
|
|
|
|
|