abstract out generateBuildName to RemoteBuilderNamespace
parent
41534d2ec6
commit
fe370d44d8
|
|
@ -1626,6 +1626,28 @@ RemoteBuilderConstants.alphabet = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghi
|
|||
exports.default = RemoteBuilderConstants;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 96003:
|
||||
/***/ (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 }));
|
||||
const nanoid_1 = __webpack_require__(39140);
|
||||
const remote_builder_constants_1 = __importDefault(__webpack_require__(92560));
|
||||
class RemoteBuilderNamespace {
|
||||
static generateBuildName(runNumber, platform) {
|
||||
const nanoid = nanoid_1.customAlphabet(remote_builder_constants_1.default.alphabet, 4);
|
||||
return `${runNumber}-${platform.replace('Standalone', '').replace('standalone', '')}-${nanoid()}`;
|
||||
}
|
||||
}
|
||||
exports.default = RemoteBuilderNamespace;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 49358:
|
||||
|
|
@ -1665,10 +1687,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
const nanoid_1 = __webpack_require__(39140);
|
||||
const aws_build_platform_1 = __importDefault(__webpack_require__(70187));
|
||||
const core = __importStar(__webpack_require__(42186));
|
||||
const remote_builder_constants_1 = __importDefault(__webpack_require__(92560));
|
||||
const remote_builder_namespace_1 = __importDefault(__webpack_require__(96003));
|
||||
const repositoryDirectoryName = 'repo';
|
||||
const efsDirectoryName = 'data';
|
||||
const cacheDirectoryName = 'cache';
|
||||
|
|
@ -1678,10 +1699,7 @@ class RemoteBuilder {
|
|||
return __awaiter(this, void 0, void 0, function* () {
|
||||
try {
|
||||
this.SteamDeploy = process.env.STEAM_DEPLOY !== undefined || false;
|
||||
const nanoid = nanoid_1.customAlphabet(remote_builder_constants_1.default.alphabet, 4);
|
||||
const buildUid = `${process.env.GITHUB_RUN_NUMBER}-${buildParameters.platform
|
||||
.replace('Standalone', '')
|
||||
.replace('standalone', '')}-${nanoid()}`;
|
||||
const buildUid = remote_builder_namespace_1.default.generateBuildName(process.env.GITHUB_RUN_NUMBER, buildParameters.platform);
|
||||
const defaultBranchName = ((_a = process.env.GITHUB_REF) === null || _a === void 0 ? void 0 : _a.split('/').filter((x) => {
|
||||
x = x[0].toUpperCase() + x.slice(1);
|
||||
return x;
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,10 @@
|
|||
import { customAlphabet } from 'nanoid';
|
||||
import RemoteBuilderConstants from './remote-builder-constants';
|
||||
|
||||
class RemoteBuilderNamespace {
|
||||
static generateBuildName(runNumber, platform) {
|
||||
const nanoid = customAlphabet(RemoteBuilderConstants.alphabet, 4);
|
||||
return `${runNumber}-${platform.replace('Standalone', '').replace('standalone', '')}-${nanoid()}`;
|
||||
}
|
||||
}
|
||||
export default RemoteBuilderNamespace;
|
||||
|
|
@ -1,8 +1,7 @@
|
|||
import { customAlphabet } from 'nanoid';
|
||||
import AWSBuildPlatform from './aws-build-platform';
|
||||
import * as core from '@actions/core';
|
||||
import RemoteBuilderConstants from './remote-builder-constants';
|
||||
import { BuildParameters } from '..';
|
||||
import RemoteBuilderNamespace from './remote-builder-namespace';
|
||||
const repositoryDirectoryName = 'repo';
|
||||
const efsDirectoryName = 'data';
|
||||
const cacheDirectoryName = 'cache';
|
||||
|
|
@ -12,10 +11,10 @@ class RemoteBuilder {
|
|||
static async build(buildParameters: BuildParameters, baseImage) {
|
||||
try {
|
||||
this.SteamDeploy = process.env.STEAM_DEPLOY !== undefined || false;
|
||||
const nanoid = customAlphabet(RemoteBuilderConstants.alphabet, 4);
|
||||
const buildUid = `${process.env.GITHUB_RUN_NUMBER}-${buildParameters.platform
|
||||
.replace('Standalone', '')
|
||||
.replace('standalone', '')}-${nanoid()}`;
|
||||
const buildUid = RemoteBuilderNamespace.generateBuildName(
|
||||
process.env.GITHUB_RUN_NUMBER,
|
||||
buildParameters.platform,
|
||||
);
|
||||
const defaultBranchName =
|
||||
process.env.GITHUB_REF?.split('/')
|
||||
.filter((x) => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue