@catladder/cli 0.0.0-refactor-docker-de6b3576 โ 0.0.0-refactor-docker-c24f8608
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundles/catenv/index.js +95 -75
- package/dist/bundles/cli/index.js +87 -63
- package/dist/cli/src/apps/catenv/catenv.js +8 -12
- package/dist/cli/src/apps/catenv/catenv.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandCloudSqlProxy.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/commandPortForward.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/setup/setupCloudRun.d.ts +2 -2
- package/dist/cli/src/apps/cli/commands/project/setup/setupCloudRun.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/setup/setupContext.d.ts +2 -2
- package/dist/cli/src/apps/cli/commands/project/setup/setupContext.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/setup/setupKubernetes.d.ts +2 -2
- package/dist/cli/src/apps/cli/commands/project/setup/setupKubernetes.js.map +1 -1
- package/dist/cli/src/apps/cli/commands/project/utils/ensureNamespace.d.ts +2 -2
- package/dist/cli/src/apps/cli/commands/project/utils/ensureNamespace.js.map +1 -1
- package/dist/cli/src/config/getProjectConfig.d.ts +2 -2
- package/dist/cli/src/config/getProjectConfig.js +1 -1
- package/dist/cli/src/config/getProjectConfig.js.map +1 -1
- package/dist/cli/src/gcloud/cloudRun/openCloudRunDashboards.d.ts +2 -2
- package/dist/cli/src/gcloud/cloudRun/openCloudRunDashboards.js.map +1 -1
- package/dist/cli/src/gcloud/serviceAccounts.d.ts +2 -2
- package/dist/cli/src/gcloud/serviceAccounts.js.map +1 -1
- package/dist/cli/src/kubernetes/openKubernetesDashboards.d.ts +3 -3
- package/dist/cli/src/kubernetes/openKubernetesDashboards.js.map +1 -1
- package/dist/cli/src/utils/gitlab.d.ts +1 -1
- package/dist/cli/src/utils/gitlab.js +37 -24
- package/dist/cli/src/utils/gitlab.js.map +1 -1
- package/dist/pipeline/src/build/base/createAppBuildJob.d.ts +2 -2
- package/dist/pipeline/src/build/base/createAppBuildJob.js +1 -1
- package/dist/pipeline/src/build/base/createAppBuildJob.js.map +1 -1
- package/dist/pipeline/src/build/base/index.d.ts +2 -2
- package/dist/pipeline/src/build/base/index.js.map +1 -1
- package/dist/pipeline/src/build/base/writeBuildInfo.d.ts +2 -2
- package/dist/pipeline/src/build/base/writeBuildInfo.js.map +1 -1
- package/dist/pipeline/src/build/base/writeDotEnv.d.ts +2 -2
- package/dist/pipeline/src/build/base/writeDotEnv.js.map +1 -1
- package/dist/pipeline/src/build/custom/buildJob.d.ts +2 -2
- package/dist/pipeline/src/build/custom/buildJob.js.map +1 -1
- package/dist/pipeline/src/build/custom/index.d.ts +2 -2
- package/dist/pipeline/src/build/custom/index.js.map +1 -1
- package/dist/pipeline/src/build/custom/testJob.d.ts +2 -2
- package/dist/pipeline/src/build/custom/testJob.js.map +1 -1
- package/dist/pipeline/src/build/docker.d.ts +11 -11
- package/dist/pipeline/src/build/docker.js +5 -5
- package/dist/pipeline/src/build/docker.js.map +1 -1
- package/dist/pipeline/src/build/index.d.ts +2 -2
- package/dist/pipeline/src/build/node/buildJob.d.ts +2 -2
- package/dist/pipeline/src/build/node/buildJob.js +9 -7
- package/dist/pipeline/src/build/node/buildJob.js.map +1 -1
- package/dist/pipeline/src/build/node/cache.d.ts +5 -5
- package/dist/pipeline/src/build/node/cache.js +4 -4
- package/dist/pipeline/src/build/node/cache.js.map +1 -1
- package/dist/pipeline/src/build/node/index.d.ts +4 -4
- package/dist/pipeline/src/build/node/index.js.map +1 -1
- package/dist/pipeline/src/build/node/meteor.d.ts +2 -2
- package/dist/pipeline/src/build/node/meteor.js +2 -2
- package/dist/pipeline/src/build/node/meteor.js.map +1 -1
- package/dist/pipeline/src/build/node/testJob.d.ts +2 -2
- package/dist/pipeline/src/build/node/testJob.js +4 -4
- package/dist/pipeline/src/build/node/testJob.js.map +1 -1
- package/dist/pipeline/src/build/node/yarn.d.ts +4 -4
- package/dist/pipeline/src/build/node/yarn.js +1 -3
- package/dist/pipeline/src/build/node/yarn.js.map +1 -1
- package/dist/pipeline/src/build/rails/build.d.ts +2 -2
- package/dist/pipeline/src/build/rails/build.js.map +1 -1
- package/dist/pipeline/src/build/rails/index.d.ts +2 -2
- package/dist/pipeline/src/build/rails/index.js.map +1 -1
- package/dist/pipeline/src/build/rails/test.d.ts +2 -2
- package/dist/pipeline/src/build/rails/test.js.map +1 -1
- package/dist/pipeline/src/build/sbom.d.ts +2 -2
- package/dist/pipeline/src/build/sbom.js +2 -2
- package/dist/pipeline/src/build/sbom.js.map +1 -1
- package/dist/pipeline/src/context/getEnvironment.d.ts +2 -2
- package/dist/pipeline/src/context/getEnvironment.js.map +1 -1
- package/dist/pipeline/src/context/getEnvironmentContext.d.ts +2 -2
- package/dist/pipeline/src/context/getEnvironmentContext.js.map +1 -1
- package/dist/pipeline/src/context/getEnvironmentVariables.d.ts +4 -4
- package/dist/pipeline/src/context/getEnvironmentVariables.js.map +1 -1
- package/dist/pipeline/src/context/getLabels.d.ts +2 -2
- package/dist/pipeline/src/context/getLabels.js.map +1 -1
- package/dist/pipeline/src/context/index.d.ts +7 -3
- package/dist/pipeline/src/context/index.js +12 -3
- package/dist/pipeline/src/context/index.js.map +1 -1
- package/dist/pipeline/src/deploy/base/deploy.d.ts +2 -2
- package/dist/pipeline/src/deploy/base/deploy.js.map +1 -1
- package/dist/pipeline/src/deploy/base/index.d.ts +2 -2
- package/dist/pipeline/src/deploy/base/index.js.map +1 -1
- package/dist/pipeline/src/deploy/base/rollback.d.ts +2 -2
- package/dist/pipeline/src/deploy/base/rollback.js.map +1 -1
- package/dist/pipeline/src/deploy/base/stop.d.ts +2 -2
- package/dist/pipeline/src/deploy/base/stop.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/artifactsRegistry.d.ts +7 -7
- package/dist/pipeline/src/deploy/cloudRun/artifactsRegistry.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/cleanup.d.ts +2 -2
- package/dist/pipeline/src/deploy/cloudRun/cleanup.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/cloudRunRevisions.d.ts +2 -2
- package/dist/pipeline/src/deploy/cloudRun/cloudRunRevisions.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/createJobs/cloudRunJobs.d.ts +6 -6
- package/dist/pipeline/src/deploy/cloudRun/createJobs/cloudRunJobs.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/createJobs/cloudRunServices.d.ts +3 -3
- package/dist/pipeline/src/deploy/cloudRun/createJobs/cloudRunServices.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/createJobs/common.d.ts +4 -4
- package/dist/pipeline/src/deploy/cloudRun/createJobs/common.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/createJobs/getCloudRunDeployScripts.d.ts +2 -2
- package/dist/pipeline/src/deploy/cloudRun/createJobs/getCloudRunDeployScripts.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/createJobs/getCloudRunStopScripts.d.ts +2 -2
- package/dist/pipeline/src/deploy/cloudRun/createJobs/getCloudRunStopScripts.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/createJobs/index.d.ts +2 -2
- package/dist/pipeline/src/deploy/cloudRun/createJobs/index.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/utils/database.d.ts +3 -3
- package/dist/pipeline/src/deploy/cloudRun/utils/database.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/utils/gcloudServiceAccountLoginCommands.d.ts +2 -2
- package/dist/pipeline/src/deploy/cloudRun/utils/gcloudServiceAccountLoginCommands.js.map +1 -1
- package/dist/pipeline/src/deploy/cloudRun/utils/getServiceName.d.ts +2 -2
- package/dist/pipeline/src/deploy/cloudRun/utils/getServiceName.js.map +1 -1
- package/dist/pipeline/src/deploy/custom/deployJob.d.ts +2 -2
- package/dist/pipeline/src/deploy/custom/deployJob.js +3 -1
- package/dist/pipeline/src/deploy/custom/deployJob.js.map +1 -1
- package/dist/pipeline/src/deploy/dockerTag/deployJob.d.ts +2 -2
- package/dist/pipeline/src/deploy/dockerTag/deployJob.js.map +1 -1
- package/dist/pipeline/src/deploy/index.d.ts +2 -2
- package/dist/pipeline/src/deploy/kubernetes/cloudSql/index.d.ts +3 -3
- package/dist/pipeline/src/deploy/kubernetes/cloudSql/index.js.map +1 -1
- package/dist/pipeline/src/deploy/kubernetes/deployJob.d.ts +2 -2
- package/dist/pipeline/src/deploy/kubernetes/deployJob.js.map +1 -1
- package/dist/pipeline/src/deploy/kubernetes/kubeEnv.d.ts +2 -2
- package/dist/pipeline/src/deploy/kubernetes/kubeEnv.js.map +1 -1
- package/dist/pipeline/src/deploy/kubernetes/kubeValues.d.ts +2 -2
- package/dist/pipeline/src/deploy/kubernetes/kubeValues.js.map +1 -1
- package/dist/pipeline/src/deploy/kubernetes/mongodb.d.ts +2 -2
- package/dist/pipeline/src/deploy/kubernetes/mongodb.js.map +1 -1
- package/dist/pipeline/src/deploy/sbom.d.ts +4 -4
- package/dist/pipeline/src/deploy/sbom.js.map +1 -1
- package/dist/pipeline/src/deploy/utils.d.ts +2 -2
- package/dist/pipeline/src/deploy/utils.js.map +1 -1
- package/dist/pipeline/src/pipeline/createJobsForComponent.d.ts +2 -2
- package/dist/pipeline/src/pipeline/createJobsForComponent.js +1 -1
- package/dist/pipeline/src/pipeline/createJobsForComponent.js.map +1 -1
- package/dist/pipeline/src/pipeline/generatePipelineFiles.js +5 -5
- package/dist/pipeline/src/pipeline/generatePipelineFiles.js.map +1 -1
- package/dist/pipeline/src/pipeline/gitlab/createGitlabJobs.js.map +1 -1
- package/dist/pipeline/src/types/config.d.ts +2 -2
- package/dist/pipeline/src/types/context.d.ts +16 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/apps/catenv/catenv.ts +8 -7
- package/src/apps/cli/commands/project/commandCloudSqlProxy.ts +3 -3
- package/src/apps/cli/commands/project/commandPortForward.ts +5 -2
- package/src/apps/cli/commands/project/setup/setupCloudRun.ts +2 -2
- package/src/apps/cli/commands/project/setup/setupContext.ts +2 -2
- package/src/apps/cli/commands/project/setup/setupKubernetes.ts +2 -2
- package/src/apps/cli/commands/project/utils/ensureNamespace.ts +2 -2
- package/src/config/getProjectConfig.ts +2 -2
- package/src/gcloud/cloudRun/openCloudRunDashboards.ts +2 -2
- package/src/gcloud/serviceAccounts.ts +3 -3
- package/src/kubernetes/openKubernetesDashboards.ts +3 -3
- package/src/utils/gitlab.ts +26 -10
|
@@ -58,19 +58,15 @@ exports["default"] = (function (choice) { return __awaiter(void 0, void 0, void
|
|
|
58
58
|
if (!config) {
|
|
59
59
|
return [2 /*return*/];
|
|
60
60
|
}
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
return [4 /*yield*/, Promise.all([
|
|
62
|
+
config.pipelineType
|
|
63
|
+
? (0, pipeline_1.generatePipelineFiles)(config, config.pipelineType, "local")
|
|
64
|
+
: undefined,
|
|
65
|
+
(0, writeDotEnvFiles_1.writeDotEnvFiles)(config, choice),
|
|
66
|
+
(0, writeEnvDTs_1.writeDTsFiles)(config, choice),
|
|
67
|
+
(0, printVariables_1.printVariables)(config, choice),
|
|
68
|
+
])];
|
|
63
69
|
case 2:
|
|
64
|
-
_a.sent();
|
|
65
|
-
_a.label = 3;
|
|
66
|
-
case 3: return [4 /*yield*/, (0, writeDotEnvFiles_1.writeDotEnvFiles)(config, choice)];
|
|
67
|
-
case 4:
|
|
68
|
-
_a.sent();
|
|
69
|
-
return [4 /*yield*/, (0, writeEnvDTs_1.writeDTsFiles)(config, choice)];
|
|
70
|
-
case 5:
|
|
71
|
-
_a.sent();
|
|
72
|
-
return [4 /*yield*/, (0, printVariables_1.printVariables)(config, choice)];
|
|
73
|
-
case 6:
|
|
74
70
|
_a.sent();
|
|
75
71
|
return [2 /*return*/];
|
|
76
72
|
}
|
|
@@ -815,7 +811,7 @@ var getPipelineContextByChoice = function (env, componentName) { return __awaite
|
|
|
815
811
|
case 0: return [4 /*yield*/, (0, exports.getProjectConfig)()];
|
|
816
812
|
case 1:
|
|
817
813
|
config = _a.sent();
|
|
818
|
-
return [4 /*yield*/, (0, pipeline_1.
|
|
814
|
+
return [4 /*yield*/, (0, pipeline_1.createComponentContext)({
|
|
819
815
|
config: config,
|
|
820
816
|
componentName: componentName,
|
|
821
817
|
env: env,
|
|
@@ -1329,31 +1325,44 @@ var getProjectInfo = function (vorpal) { return __awaiter(void 0, void 0, void 0
|
|
|
1329
1325
|
});
|
|
1330
1326
|
}); };
|
|
1331
1327
|
exports.getProjectInfo = getProjectInfo;
|
|
1332
|
-
exports.getAllVariables = (0, memoizee_1.default)(function (
|
|
1333
|
-
var
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1328
|
+
exports.getAllVariables = (0, memoizee_1.default)(function (vorpal_1) {
|
|
1329
|
+
var args_1 = [];
|
|
1330
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
1331
|
+
args_1[_i - 1] = arguments[_i];
|
|
1332
|
+
}
|
|
1333
|
+
return __awaiter(void 0, __spreadArray([vorpal_1], __read(args_1), false), void 0, function (vorpal, n) {
|
|
1334
|
+
var id, all, result, page, promises;
|
|
1335
|
+
if (n === void 0) { n = 5; }
|
|
1336
|
+
return __generator(this, function (_a) {
|
|
1337
|
+
switch (_a.label) {
|
|
1338
|
+
case 0: return [4 /*yield*/, (0, exports.getProjectInfo)(vorpal)];
|
|
1339
|
+
case 1:
|
|
1340
|
+
id = (_a.sent()).id;
|
|
1341
|
+
all = [];
|
|
1342
|
+
result = [];
|
|
1343
|
+
page = 1;
|
|
1344
|
+
_a.label = 2;
|
|
1345
|
+
case 2:
|
|
1346
|
+
promises = Array.from({ length: n }, function (_, i) {
|
|
1347
|
+
return (0, exports.doGitlabRequest)(vorpal, "projects/".concat(id, "/variables?per_page=100&page=").concat(page + i));
|
|
1348
|
+
});
|
|
1349
|
+
return [4 /*yield*/, Promise.all(promises)];
|
|
1350
|
+
case 3:
|
|
1351
|
+
// Wait for all promises to resolve
|
|
1352
|
+
result = _a.sent();
|
|
1353
|
+
// Increment the page by N
|
|
1354
|
+
page += n;
|
|
1355
|
+
// Flatten the result array and add it to 'all'
|
|
1356
|
+
all = __spreadArray(__spreadArray([], __read(all), false), __read(result.flat()), false);
|
|
1357
|
+
_a.label = 4;
|
|
1358
|
+
case 4:
|
|
1359
|
+
if (result.length > 0 && result[result.length - 1].length > 0) return [3 /*break*/, 2];
|
|
1360
|
+
_a.label = 5;
|
|
1361
|
+
case 5: return [2 /*return*/, all];
|
|
1362
|
+
}
|
|
1363
|
+
});
|
|
1355
1364
|
});
|
|
1356
|
-
}
|
|
1365
|
+
}, { promise: true });
|
|
1357
1366
|
var getVariableValueByRawName = function (vorpal, rawName) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1358
1367
|
var allVariables;
|
|
1359
1368
|
var _a;
|
|
@@ -2262,7 +2271,7 @@ var createAppBuildJob = function (context, _a) {
|
|
|
2262
2271
|
runnerVariables: __assign(__assign(__assign({}, constants_1.RUNNER_BUILD_RESOURCE_VARIABLES), (runnerVariables !== null && runnerVariables !== void 0 ? runnerVariables : {})), ((_c = context.componentConfig.build.runnerVariables) !== null && _c !== void 0 ? _c : {})),
|
|
2263
2272
|
script: __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((context.componentConfig.dotEnv === true // don't build when set to `local`
|
|
2264
2273
|
? (0, writeDotEnv_1.writeDotEnv)(context)
|
|
2265
|
-
: [])), false), __read((0, writeBuildInfo_1.writeBuildInfo)(context)), false), __read((0, yarn_1.ensureNodeVersion)(context)), false), [
|
|
2274
|
+
: [])), false), __read((0, writeBuildInfo_1.writeBuildInfo)(context)), false), __read((0, yarn_1.ensureNodeVersion)(context.buildContext)), false), [
|
|
2266
2275
|
"cd ".concat(context.componentConfig.dir)
|
|
2267
2276
|
], false), __read(((_d = (0, utils_1.ensureArray)(script)) !== null && _d !== void 0 ? _d : [])), false),
|
|
2268
2277
|
artifacts: {
|
|
@@ -2737,14 +2746,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
2737
2746
|
};
|
|
2738
2747
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
2739
2748
|
exports.hasDockerfile = exports.getDockerBuildDefaultScript = exports.getDockerBuildScriptWithBuiltInDockerFile = exports.gitlabDockerLogin = exports.createDockerBuildJobBase = exports.getDockerJobBaseProps = exports.DOCKER_BUILD_JOB_NAME = exports.getDockerBuildVariables = exports.requiresDockerBuild = exports.getDockerImageVariables = void 0;
|
|
2740
|
-
var lodash_1 = __nccwpck_require__(3255);
|
|
2741
|
-
var deploy_1 = __nccwpck_require__(8483);
|
|
2742
|
-
var runner_1 = __nccwpck_require__(4058);
|
|
2743
2749
|
var fs_1 = __nccwpck_require__(7147);
|
|
2750
|
+
var lodash_1 = __nccwpck_require__(3255);
|
|
2744
2751
|
var path_1 = __importDefault(__nccwpck_require__(1017));
|
|
2745
|
-
var
|
|
2752
|
+
var deploy_1 = __nccwpck_require__(8483);
|
|
2746
2753
|
var artifactsRegistry_1 = __nccwpck_require__(4963);
|
|
2747
2754
|
var gcloudServiceAccountLoginCommands_1 = __nccwpck_require__(6320);
|
|
2755
|
+
var runner_1 = __nccwpck_require__(4058);
|
|
2756
|
+
var gitlab_1 = __nccwpck_require__(8490);
|
|
2748
2757
|
var DOCKER_BUILD_RUNNER_REQUESTS = {
|
|
2749
2758
|
KUBERNETES_CPU_REQUEST: "0.5",
|
|
2750
2759
|
KUBERNETES_MEMORY_REQUEST: "1Gi",
|
|
@@ -2799,7 +2808,7 @@ var getDockerAdditions = function (build) {
|
|
|
2799
2808
|
};
|
|
2800
2809
|
};
|
|
2801
2810
|
var getDockerBuildVariables = function (context) {
|
|
2802
|
-
return __assign(__assign(__assign({}, getDockerAdditions(context.
|
|
2811
|
+
return __assign(__assign(__assign({}, getDockerAdditions(context.buildContext.config)), { APP_DIR: context.buildContext.dir, DOCKER_DIR: "." }), (0, exports.getDockerImageVariables)(context));
|
|
2803
2812
|
};
|
|
2804
2813
|
exports.getDockerBuildVariables = getDockerBuildVariables;
|
|
2805
2814
|
exports.DOCKER_BUILD_JOB_NAME = "๐จ docker";
|
|
@@ -2989,18 +2998,18 @@ var createNodeBuildJobs = function (context) {
|
|
|
2989
2998
|
throw new Error("deploy config is not node, node-static or storybook");
|
|
2990
2999
|
}
|
|
2991
3000
|
var defaultImage = (0, runner_1.getRunnerImage)("jobs-default");
|
|
2992
|
-
var yarnInstall = (0, yarn_1.getYarnInstall)(context);
|
|
3001
|
+
var yarnInstall = (0, yarn_1.getYarnInstall)(context.buildContext);
|
|
2993
3002
|
return (0, base_1.createBuildJobs)(context, {
|
|
2994
3003
|
appBuild: buildConfig.buildCommand !== null
|
|
2995
3004
|
? {
|
|
2996
3005
|
image: (_a = buildConfig.jobImage) !== null && _a !== void 0 ? _a : defaultImage,
|
|
2997
3006
|
runnerVariables: constants_1.NODE_RUNNER_BUILD_VARIABLES,
|
|
2998
|
-
cache: __spreadArray(__spreadArray(__spreadArray([], __read(((_b = (0, utils_1.ensureArray)(buildConfig.jobCache)) !== null && _b !== void 0 ? _b : [])), false), __read((0, cache_1.getNodeCache)(context)), false), __read((0, cache_1.getNextCache)(context)), false),
|
|
3007
|
+
cache: __spreadArray(__spreadArray(__spreadArray([], __read(((_b = (0, utils_1.ensureArray)(buildConfig.jobCache)) !== null && _b !== void 0 ? _b : [])), false), __read((0, cache_1.getNodeCache)(context.buildContext)), false), __read((0, cache_1.getNextCache)(context)), false),
|
|
2999
3008
|
script: __spreadArray(__spreadArray([], __read(yarnInstall), false), __read(((_c = (0, utils_1.ensureArray)(buildConfig.buildCommand)) !== null && _c !== void 0 ? _c : [])), false),
|
|
3000
3009
|
artifacts: {
|
|
3001
3010
|
paths: __spreadArray([
|
|
3002
3011
|
context.componentConfig.dir
|
|
3003
|
-
], __read(((_e = (_d = context.packageManagerInfo) === null || _d === void 0 ? void 0 : _d.currentWorkspaceDependencies) !== null && _e !== void 0 ? _e : [])), false).flatMap(function (dir) {
|
|
3012
|
+
], __read(((_e = (_d = context.buildContext.packageManagerInfo) === null || _d === void 0 ? void 0 : _d.currentWorkspaceDependencies) !== null && _e !== void 0 ? _e : [])), false).flatMap(function (dir) {
|
|
3004
3013
|
var _a, _b;
|
|
3005
3014
|
return __spreadArray([
|
|
3006
3015
|
(0, path_1.join)(dir, "__build_info.json"),
|
|
@@ -3017,12 +3026,14 @@ var createNodeBuildJobs = function (context) {
|
|
|
3017
3026
|
}
|
|
3018
3027
|
: undefined,
|
|
3019
3028
|
dockerBuild: {
|
|
3020
|
-
script: (0, docker_1.getDockerBuildScriptWithBuiltInDockerFile)(context, buildConfig.type === "node-static"
|
|
3021
|
-
|
|
3029
|
+
script: (0, docker_1.getDockerBuildScriptWithBuiltInDockerFile)(context, buildConfig.type === "node-static" || buildConfig.type === "storybook"
|
|
3030
|
+
? "nginx"
|
|
3031
|
+
: "node"),
|
|
3032
|
+
cache: __spreadArray([], __read((0, cache_1.getYarnCache)(context.buildContext, "pull")), false),
|
|
3022
3033
|
variables: {
|
|
3023
3034
|
// only required for non static
|
|
3024
|
-
DOCKER_COPY_AND_INSTALL_APP: (0, yarn_1.getDockerAppCopyAndBuildScript)(context),
|
|
3025
|
-
DOCKER_COPY_WORKSPACE_FILES: (_g = (_f = context.packageManagerInfo) === null || _f === void 0 ? void 0 : _f.pathsToCopyInDocker.map(function (dir) { return "COPY --chown=node:node ".concat(dir, " /app/").concat(dir); })) === null || _g === void 0 ? void 0 : _g.join("\n"),
|
|
3035
|
+
DOCKER_COPY_AND_INSTALL_APP: (0, yarn_1.getDockerAppCopyAndBuildScript)(context.buildContext),
|
|
3036
|
+
DOCKER_COPY_WORKSPACE_FILES: (_g = (_f = context.buildContext.packageManagerInfo) === null || _f === void 0 ? void 0 : _f.pathsToCopyInDocker.map(function (dir) { return "COPY --chown=node:node ".concat(dir, " /app/").concat(dir); })) === null || _g === void 0 ? void 0 : _g.join("\n"),
|
|
3026
3037
|
},
|
|
3027
3038
|
},
|
|
3028
3039
|
});
|
|
@@ -3082,9 +3093,9 @@ var getYarnCache = function (context, policy) {
|
|
|
3082
3093
|
paths: [".yarn"],
|
|
3083
3094
|
}
|
|
3084
3095
|
: {
|
|
3085
|
-
key: (0, slugify_1.default)(context.
|
|
3096
|
+
key: (0, slugify_1.default)(context.dir) + "-yarn",
|
|
3086
3097
|
policy: policy,
|
|
3087
|
-
paths: [(0, path_1.join)(context.
|
|
3098
|
+
paths: [(0, path_1.join)(context.dir, ".yarn")],
|
|
3088
3099
|
},
|
|
3089
3100
|
];
|
|
3090
3101
|
};
|
|
@@ -3100,7 +3111,7 @@ var getNodeModulesCache = function (context, policy) {
|
|
|
3100
3111
|
// if component is in a shared workspace, use workspace cache. use individual cache else
|
|
3101
3112
|
key: componentIsInWorkspace
|
|
3102
3113
|
? "node-modules-workspace"
|
|
3103
|
-
: (0, slugify_1.default)(context.
|
|
3114
|
+
: (0, slugify_1.default)(context.dir) + "-node-modules", // we use the dirname, not the component name, because in certain cases we have two apps in the same directory and want to share the cache, e.g. when having storybook in the same package.json
|
|
3104
3115
|
policy: policy,
|
|
3105
3116
|
paths: __spreadArray([], __read((componentIsInWorkspace
|
|
3106
3117
|
? (0, lodash_1.uniq)(__spreadArray([
|
|
@@ -3108,7 +3119,7 @@ var getNodeModulesCache = function (context, policy) {
|
|
|
3108
3119
|
], __read(((_c = (_b = context.packageManagerInfo) === null || _b === void 0 ? void 0 : _b.workspaces.map(function (w) {
|
|
3109
3120
|
return (0, path_1.join)(w.location, "node_modules");
|
|
3110
3121
|
})) !== null && _c !== void 0 ? _c : [])), false))
|
|
3111
|
-
: [(0, path_1.join)(context.
|
|
3122
|
+
: [(0, path_1.join)(context.dir, "node_modules")])), false),
|
|
3112
3123
|
},
|
|
3113
3124
|
];
|
|
3114
3125
|
};
|
|
@@ -3253,11 +3264,11 @@ var createMeteorBuildJobs = function (context) {
|
|
|
3253
3264
|
if (!(0, types_1.isOfBuildType)(buildConfig, "meteor")) {
|
|
3254
3265
|
throw new Error("deploy config is not meteor");
|
|
3255
3266
|
}
|
|
3256
|
-
var yarnInstall = (0, yarn_1.getYarnInstall)(context);
|
|
3267
|
+
var yarnInstall = (0, yarn_1.getYarnInstall)(context.buildContext);
|
|
3257
3268
|
return (0, base_1.createBuildJobs)(context, {
|
|
3258
3269
|
appBuild: buildConfig.buildCommand !== null
|
|
3259
3270
|
? {
|
|
3260
|
-
cache: __spreadArray(__spreadArray([], __read((0, cache_1.getNodeCache)(context)), false), __read(getMeteorCache(context)), false),
|
|
3271
|
+
cache: __spreadArray(__spreadArray([], __read((0, cache_1.getNodeCache)(context.buildContext)), false), __read(getMeteorCache(context)), false),
|
|
3261
3272
|
image: (0, runner_1.getRunnerImage)("jobs-meteor"),
|
|
3262
3273
|
variables: {
|
|
3263
3274
|
METEOR_DISABLE_OPTIMISTIC_CACHING: "1", // see https://forums.meteor.com/t/veeery-long-building-time-inside-docker-container/58673/17?u=macrozone
|
|
@@ -3355,21 +3366,21 @@ var createNodeTestJobs = function (context) {
|
|
|
3355
3366
|
needs: [],
|
|
3356
3367
|
envMode: "none",
|
|
3357
3368
|
};
|
|
3358
|
-
var yarnInstall = (0, yarn_1.getYarnInstall)(context);
|
|
3369
|
+
var yarnInstall = (0, yarn_1.getYarnInstall)(context.buildContext);
|
|
3359
3370
|
var auditJob = buildConfig.audit !== false
|
|
3360
3371
|
? __assign(__assign(__assign({ name: "๐ก audit" }, base), { image: (_c = (_b = buildConfig.audit) === null || _b === void 0 ? void 0 : _b.jobImage) !== null && _c !== void 0 ? _c : defaultImage, cache: undefined, script: __spreadArray([
|
|
3361
3372
|
"cd ".concat(context.componentConfig.dir)
|
|
3362
3373
|
], __read(((_e = (0, utils_1.ensureArray)((_d = buildConfig.audit) === null || _d === void 0 ? void 0 : _d.command)) !== null && _e !== void 0 ? _e : [
|
|
3363
|
-
((_f = context.packageManagerInfo) === null || _f === void 0 ? void 0 : _f.isClassic)
|
|
3374
|
+
((_f = context.buildContext.packageManagerInfo) === null || _f === void 0 ? void 0 : _f.isClassic)
|
|
3364
3375
|
? "yarn audit"
|
|
3365
3376
|
: "yarn npm audit --environment production", // yarn 2
|
|
3366
3377
|
])), false), allow_failure: true }), (0, createArtifactsConfig_1.createArtifactsConfig)(context.componentConfig.dir, (_g = buildConfig.audit) === null || _g === void 0 ? void 0 : _g.artifactsReports, (_h = buildConfig.audit) === null || _h === void 0 ? void 0 : _h.artifacts)) : null;
|
|
3367
3378
|
var lintJob = buildConfig.lint !== false
|
|
3368
|
-
? __assign(__assign(__assign({ name: "๐ฎ lint" }, base), { image: (_k = (_j = buildConfig.lint) === null || _j === void 0 ? void 0 : _j.jobImage) !== null && _k !== void 0 ? _k : defaultImage, cache: (0, cache_1.getNodeCache)(context), script: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, yarn_1.ensureNodeVersion)(context)), false), [
|
|
3379
|
+
? __assign(__assign(__assign({ name: "๐ฎ lint" }, base), { image: (_k = (_j = buildConfig.lint) === null || _j === void 0 ? void 0 : _j.jobImage) !== null && _k !== void 0 ? _k : defaultImage, cache: (0, cache_1.getNodeCache)(context.buildContext), script: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, yarn_1.ensureNodeVersion)(context.buildContext)), false), [
|
|
3369
3380
|
"cd ".concat(context.componentConfig.dir)
|
|
3370
3381
|
], false), __read(yarnInstall), false), __read(((_m = (0, utils_1.ensureArray)((_l = buildConfig.lint) === null || _l === void 0 ? void 0 : _l.command)) !== null && _m !== void 0 ? _m : ["yarn lint"])), false) }), (0, createArtifactsConfig_1.createArtifactsConfig)(context.componentConfig.dir, (_o = buildConfig.lint) === null || _o === void 0 ? void 0 : _o.artifactsReports, (_p = buildConfig.lint) === null || _p === void 0 ? void 0 : _p.artifacts)) : null;
|
|
3371
3382
|
var testJob = buildConfig.test !== false
|
|
3372
|
-
? __assign(__assign(__assign({ name: "๐งช test" }, base), { image: (_r = (_q = buildConfig.test) === null || _q === void 0 ? void 0 : _q.jobImage) !== null && _r !== void 0 ? _r : (0, runner_1.getRunnerImage)("jobs-testing-chrome"), cache: (0, cache_1.getNodeCache)(context), script: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, yarn_1.ensureNodeVersion)(context)), false), [
|
|
3383
|
+
? __assign(__assign(__assign({ name: "๐งช test" }, base), { image: (_r = (_q = buildConfig.test) === null || _q === void 0 ? void 0 : _q.jobImage) !== null && _r !== void 0 ? _r : (0, runner_1.getRunnerImage)("jobs-testing-chrome"), cache: (0, cache_1.getNodeCache)(context.buildContext), script: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, yarn_1.ensureNodeVersion)(context.buildContext)), false), [
|
|
3373
3384
|
"cd ".concat(context.componentConfig.dir)
|
|
3374
3385
|
], false), __read(yarnInstall), false), __read(((_t = (0, utils_1.ensureArray)((_s = buildConfig.test) === null || _s === void 0 ? void 0 : _s.command)) !== null && _t !== void 0 ? _t : ["yarn test"])), false) }), (0, createArtifactsConfig_1.createArtifactsConfig)(context.componentConfig.dir, (_u = buildConfig.test) === null || _u === void 0 ? void 0 : _u.artifactsReports, (_v = buildConfig.test) === null || _v === void 0 ? void 0 : _v.artifacts)) : null;
|
|
3375
3386
|
return [auditJob, lintJob, testJob].filter(utils_1.notNil);
|
|
@@ -3433,9 +3444,7 @@ var ensureNodeVersion = function (context) {
|
|
|
3433
3444
|
exports.ensureNodeVersion = ensureNodeVersion;
|
|
3434
3445
|
var getYarnInstall = function (context, options) {
|
|
3435
3446
|
var _a;
|
|
3436
|
-
var postInstall = "postInstall" in context.
|
|
3437
|
-
? context.componentConfig.build.postInstall
|
|
3438
|
-
: null;
|
|
3447
|
+
var postInstall = "postInstall" in context.config ? context.config.postInstall : null;
|
|
3439
3448
|
return __spreadArray(__spreadArray(__spreadArray([], __read((0, exports.ensureNodeVersion)(context)), false), __read((0, gitlab_1.collapseableSection)("yarninstall", "Yarn install")([getYarnInstallCommand(context)])), false), __read((postInstall && !(options === null || options === void 0 ? void 0 : options.noCustomPostInstall)
|
|
3440
3449
|
? (0, gitlab_1.collapseableSection)("postinstall", "Custom post install")((_a = (0, utils_1.ensureArray)(postInstall)) !== null && _a !== void 0 ? _a : [])
|
|
3441
3450
|
: [])), false);
|
|
@@ -3707,9 +3716,9 @@ var createSbomBuildJob = function (context) {
|
|
|
3707
3716
|
var buildConfig = context.componentConfig.build;
|
|
3708
3717
|
var defaultImage = "aquasec/trivy:0.38.3";
|
|
3709
3718
|
var defaultScript = [
|
|
3710
|
-
"trivy fs --quiet --format cyclonedx --output \"".concat(exports.SBOM_FILE, "\" ").concat(((_a = context.packageManagerInfo) === null || _a === void 0 ? void 0 : _a.componentIsInWorkspace)
|
|
3719
|
+
"trivy fs --quiet --format cyclonedx --output \"".concat(exports.SBOM_FILE, "\" ").concat(((_a = context.buildContext.packageManagerInfo) === null || _a === void 0 ? void 0 : _a.componentIsInWorkspace)
|
|
3711
3720
|
? "."
|
|
3712
|
-
: context.
|
|
3721
|
+
: context.buildContext.dir),
|
|
3713
3722
|
];
|
|
3714
3723
|
var image = buildConfig.type === "custom" && buildConfig.sbom !== false
|
|
3715
3724
|
? (_c = (_b = buildConfig.sbom) === null || _b === void 0 ? void 0 : _b.jobImage) !== null && _c !== void 0 ? _c : defaultImage
|
|
@@ -4425,7 +4434,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
4425
4434
|
}
|
|
4426
4435
|
};
|
|
4427
4436
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
4428
|
-
exports.createContext = void 0;
|
|
4437
|
+
exports.createContext = exports.createComponentContext = void 0;
|
|
4429
4438
|
var build_1 = __nccwpck_require__(7862);
|
|
4430
4439
|
var deploy_1 = __nccwpck_require__(8483);
|
|
4431
4440
|
var utils_1 = __nccwpck_require__(2497);
|
|
@@ -4433,7 +4442,7 @@ var getEnvironment_1 = __nccwpck_require__(5699);
|
|
|
4433
4442
|
var getEnvironmentContext_1 = __nccwpck_require__(3663);
|
|
4434
4443
|
__exportStar(__nccwpck_require__(5699), exports);
|
|
4435
4444
|
__exportStar(__nccwpck_require__(5133), exports);
|
|
4436
|
-
var
|
|
4445
|
+
var createComponentContext = function (ctx) { return __awaiter(void 0, void 0, void 0, function () {
|
|
4437
4446
|
var envContext, componentConfigWithoutDefaults, defaults, componentConfig;
|
|
4438
4447
|
var _a;
|
|
4439
4448
|
return __generator(this, function (_b) {
|
|
@@ -4457,6 +4466,11 @@ var createContext = function (ctx) { return __awaiter(void 0, void 0, void 0, fu
|
|
|
4457
4466
|
_a = {
|
|
4458
4467
|
fullConfig: ctx.config,
|
|
4459
4468
|
componentConfig: componentConfig,
|
|
4469
|
+
buildContext: {
|
|
4470
|
+
dir: componentConfig.dir,
|
|
4471
|
+
packageManagerInfo: ctx.packageManagerInfo,
|
|
4472
|
+
config: componentConfig.build,
|
|
4473
|
+
},
|
|
4460
4474
|
componentName: ctx.componentName
|
|
4461
4475
|
};
|
|
4462
4476
|
return [4 /*yield*/, (0, getEnvironment_1.getEnvironment)(ctx)];
|
|
@@ -4468,7 +4482,11 @@ var createContext = function (ctx) { return __awaiter(void 0, void 0, void 0, fu
|
|
|
4468
4482
|
}
|
|
4469
4483
|
});
|
|
4470
4484
|
}); };
|
|
4471
|
-
exports.
|
|
4485
|
+
exports.createComponentContext = createComponentContext;
|
|
4486
|
+
/**
|
|
4487
|
+
* @deprecated use createComponentContext instead
|
|
4488
|
+
*/
|
|
4489
|
+
exports.createContext = exports.createComponentContext;
|
|
4472
4490
|
//# sourceMappingURL=index.js.map
|
|
4473
4491
|
|
|
4474
4492
|
/***/ }),
|
|
@@ -6360,7 +6378,9 @@ var createCustomDeployJobs = function (context) {
|
|
|
6360
6378
|
throw new Error("deploy config is not custom");
|
|
6361
6379
|
}
|
|
6362
6380
|
// FIXME: custom deploy currently assumes yarn-based project
|
|
6363
|
-
var yarnInstall = (0, yarn_1.getYarnInstall)(context, {
|
|
6381
|
+
var yarnInstall = (0, yarn_1.getYarnInstall)(context.buildContext, {
|
|
6382
|
+
noCustomPostInstall: true,
|
|
6383
|
+
});
|
|
6364
6384
|
return (0, base_1.createDeployementJobs)(context, {
|
|
6365
6385
|
deploy: {
|
|
6366
6386
|
image: (_a = deployConfig.jobImage) !== null && _a !== void 0 ? _a : (0, runner_1.getRunnerImage)("jobs-default"),
|
|
@@ -7661,7 +7681,7 @@ var createJobsForComponent = function (contextContext) { return __awaiter(void 0
|
|
|
7661
7681
|
case 0: return [4 /*yield*/, (0, packageManager_1.getPackageManagerInfo)(contextContext.config, contextContext.componentName)];
|
|
7662
7682
|
case 1:
|
|
7663
7683
|
packageManagerInfo = _a.sent();
|
|
7664
|
-
return [4 /*yield*/, (0, context_1.
|
|
7684
|
+
return [4 /*yield*/, (0, context_1.createComponentContext)(__assign(__assign({}, contextContext), { packageManagerInfo: packageManagerInfo }))];
|
|
7665
7685
|
case 2:
|
|
7666
7686
|
context = _a.sent();
|
|
7667
7687
|
return [2 /*return*/, createRawJobs(context).map(function (job) { return (__assign(__assign({}, job), { context: context })); })];
|
|
@@ -7900,7 +7920,7 @@ var createMainPipeline_1 = __nccwpck_require__(9192);
|
|
|
7900
7920
|
var getPipelineTriggerForGitlabChildPipeline_1 = __nccwpck_require__(7426);
|
|
7901
7921
|
function generatePipelineFiles(config, pipelineType, mode) {
|
|
7902
7922
|
return __awaiter(this, void 0, void 0, function () {
|
|
7903
|
-
var trigger, _a, jobs, mainPipeline, _b, jobs, mainPipeline;
|
|
7923
|
+
var trigger, _a, jobs, image, stages, variables, workflow, mainPipeline, _b, jobs, image, stages, variables, workflow, mainPipeline;
|
|
7904
7924
|
return __generator(this, function (_c) {
|
|
7905
7925
|
switch (_c.label) {
|
|
7906
7926
|
case 0:
|
|
@@ -7908,18 +7928,18 @@ function generatePipelineFiles(config, pipelineType, mode) {
|
|
|
7908
7928
|
trigger = (0, getPipelineTriggerForGitlabChildPipeline_1.getPipelineTriggerForGitlabChildPipeline)();
|
|
7909
7929
|
return [4 /*yield*/, (0, createChildPipeline_1.createChildPipeline)(pipelineType, trigger, config)];
|
|
7910
7930
|
case 1:
|
|
7911
|
-
_a = _c.sent(), jobs = _a.jobs, mainPipeline = __rest(_a, ["jobs"]);
|
|
7931
|
+
_a = _c.sent(), jobs = _a.jobs, image = _a.image, stages = _a.stages, variables = _a.variables, workflow = _a.workflow, mainPipeline = __rest(_a, ["jobs", "image", "stages", "variables", "workflow"]);
|
|
7912
7932
|
// need to spread out the jobs, forgot why
|
|
7913
|
-
return [4 /*yield*/, (0, writeFiles_1.writeYamlfile)("__pipeline.yml", __assign(__assign({},
|
|
7933
|
+
return [4 /*yield*/, (0, writeFiles_1.writeYamlfile)("__pipeline.yml", __assign(__assign({ image: image, stages: stages, variables: variables, workflow: workflow }, mainPipeline), jobs))];
|
|
7914
7934
|
case 2:
|
|
7915
7935
|
// need to spread out the jobs, forgot why
|
|
7916
7936
|
_c.sent();
|
|
7917
7937
|
return [3 /*break*/, 6];
|
|
7918
7938
|
case 3: return [4 /*yield*/, (0, createMainPipeline_1.createMainPipeline)(pipelineType, config)];
|
|
7919
7939
|
case 4:
|
|
7920
|
-
_b = _c.sent(), jobs = _b.jobs, mainPipeline = __rest(_b, ["jobs"]);
|
|
7940
|
+
_b = _c.sent(), jobs = _b.jobs, image = _b.image, stages = _b.stages, variables = _b.variables, workflow = _b.workflow, mainPipeline = __rest(_b, ["jobs", "image", "stages", "variables", "workflow"]);
|
|
7921
7941
|
// need to spread out the jobs, forgot why
|
|
7922
|
-
return [4 /*yield*/, (0, writeFiles_1.writeYamlfile)(".gitlab-ci.yml", __assign(__assign({},
|
|
7942
|
+
return [4 /*yield*/, (0, writeFiles_1.writeYamlfile)(".gitlab-ci.yml", __assign(__assign({ image: image, stages: stages, variables: variables, workflow: workflow }, mainPipeline), jobs))];
|
|
7923
7943
|
case 5:
|
|
7924
7944
|
// need to spread out the jobs, forgot why
|
|
7925
7945
|
_c.sent();
|