@catladder/pipeline 0.0.0-refactor-cloud-run-825d7e86 → 0.0.0-refactor-docker-9fda97e9
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/bash/BashExpression.d.ts +40 -0
- package/dist/bash/BashExpression.js +124 -0
- package/dist/bash/bashExpressionPerPipelineType.d.ts +6 -0
- package/dist/bash/bashExpressionPerPipelineType.js +11 -0
- package/dist/bash/bashYaml.d.ts +10 -0
- package/dist/bash/bashYaml.js +46 -0
- package/dist/bash/getInjectVarsScript.d.ts +2 -0
- package/dist/bash/getInjectVarsScript.js +45 -0
- package/dist/bash/replaceAsync.d.ts +2 -0
- package/dist/{pipeline/commitInfo/getCommitInfo.js → bash/replaceAsync.js} +49 -21
- package/dist/build/base/__tests__/createArtifactsConfig.test.js +3 -1
- package/dist/build/base/constants.js +3 -1
- package/dist/build/base/createAppBuildJob.d.ts +2 -1
- package/dist/build/base/createAppBuildJob.js +11 -6
- package/dist/build/base/createArtifactsConfig.d.ts +1 -1
- package/dist/build/base/createArtifactsConfig.js +3 -1
- package/dist/build/base/index.js +3 -1
- package/dist/build/base/writeBuildInfo.js +4 -3
- package/dist/build/base/writeDotEnv.js +12 -3
- package/dist/build/custom/__tests__/testJob.test.js +3 -1
- package/dist/build/custom/buildJob.js +6 -14
- package/dist/build/custom/index.js +3 -1
- package/dist/build/custom/testJob.d.ts +1 -1
- package/dist/build/custom/testJob.js +18 -14
- package/dist/build/docker.d.ts +28 -33
- package/dist/build/docker.js +39 -14
- package/dist/build/index.d.ts +1 -1
- package/dist/build/index.js +13 -7
- package/dist/build/node/buildJob.js +5 -13
- package/dist/build/node/cache.js +6 -3
- package/dist/build/node/constants.js +3 -1
- package/dist/build/node/index.js +3 -1
- package/dist/build/node/meteor.js +6 -3
- package/dist/build/node/testJob.js +18 -14
- package/dist/build/node/yarn.d.ts +3 -2
- package/dist/build/node/yarn.js +6 -3
- package/dist/build/rails/build.js +4 -2
- package/dist/build/rails/index.js +3 -1
- package/dist/build/rails/test.js +15 -11
- package/dist/build/sbom.js +3 -1
- package/dist/build/types.d.ts +57 -43
- package/dist/build/types.js +3 -1
- package/dist/bundles/catladder-gitlab/index.js +31112 -25265
- package/dist/catladder-gitlab.js +10 -54
- package/dist/config/__tests__/configruedEnvs.test.js +3 -1
- package/dist/config/configruedEnvs.js +3 -1
- package/dist/config/index.js +13 -7
- package/dist/config/readConfig.js +6 -5
- package/dist/constants.js +5 -3
- package/dist/context/__tests__/resolveReferences.test.js +40 -8
- package/dist/context/getBuildInfoVariables.d.ts +7 -0
- package/dist/context/getBuildInfoVariables.js +29 -0
- package/dist/context/getEnvConfig.js +3 -1
- package/dist/context/getEnvType.js +3 -1
- package/dist/context/getEnvironment.d.ts +3 -3
- package/dist/context/getEnvironment.js +10 -10
- package/dist/context/getEnvironmentContext.d.ts +7 -3
- package/dist/context/getEnvironmentContext.js +21 -11
- package/dist/context/getEnvironmentVariables.d.ts +26 -5
- package/dist/context/getEnvironmentVariables.js +41 -25
- package/dist/context/getLabels.js +4 -2
- package/dist/context/getReviewSlug.d.ts +4 -0
- package/dist/context/getReviewSlug.js +22 -0
- package/dist/context/index.d.ts +12 -3
- package/dist/context/index.js +21 -15
- package/dist/context/resolveReferences.d.ts +3 -1
- package/dist/context/resolveReferences.js +54 -22
- package/dist/context/transformJobOnlyVars.d.ts +5 -2
- package/dist/context/transformJobOnlyVars.js +4 -2
- package/dist/context/utils/envVars.d.ts +1 -1
- package/dist/context/utils/envVars.js +5 -2
- package/dist/defaults/index.js +3 -1
- package/dist/deploy/base/deploy.d.ts +1 -1
- package/dist/deploy/base/deploy.js +12 -11
- package/dist/deploy/base/index.js +3 -1
- package/dist/deploy/base/rollback.d.ts +1 -1
- package/dist/deploy/base/rollback.js +13 -9
- package/dist/deploy/base/stop.d.ts +1 -1
- package/dist/deploy/base/stop.js +16 -11
- package/dist/deploy/base/types.d.ts +1 -1
- package/dist/deploy/base/types.js +3 -1
- package/dist/deploy/base/variables.js +3 -1
- package/dist/deploy/cloudRun/artifactsRegistry.d.ts +2 -1
- package/dist/deploy/cloudRun/artifactsRegistry.js +6 -4
- package/dist/deploy/cloudRun/cleanup.js +3 -1
- package/dist/deploy/cloudRun/cloudRunRevisions.js +3 -1
- package/dist/deploy/cloudRun/createJobs/cloudRunJobs.js +20 -11
- package/dist/deploy/cloudRun/createJobs/cloudRunServices.d.ts +2 -2
- package/dist/deploy/cloudRun/createJobs/cloudRunServices.js +47 -8
- package/dist/deploy/cloudRun/createJobs/common.d.ts +3 -0
- package/dist/deploy/cloudRun/createJobs/common.js +17 -3
- package/dist/deploy/cloudRun/createJobs/constants.d.ts +1 -0
- package/dist/deploy/cloudRun/createJobs/constants.js +7 -0
- package/dist/deploy/cloudRun/createJobs/getCloudRunDeployScripts.js +9 -2
- package/dist/deploy/cloudRun/createJobs/getCloudRunStopScripts.js +3 -1
- package/dist/deploy/cloudRun/createJobs/index.js +25 -8
- package/dist/deploy/cloudRun/createJobs/volumes.d.ts +3 -0
- package/dist/deploy/cloudRun/createJobs/volumes.js +58 -0
- package/dist/deploy/cloudRun/index.js +13 -7
- package/dist/deploy/cloudRun/utils/createArgsString.d.ts +3 -1
- package/dist/deploy/cloudRun/utils/createArgsString.js +25 -17
- package/dist/deploy/cloudRun/utils/database.d.ts +4 -2
- package/dist/deploy/cloudRun/utils/database.js +28 -15
- package/dist/deploy/cloudRun/utils/gcloudServiceAccountLoginCommands.js +3 -1
- package/dist/deploy/cloudRun/utils/getServiceName.d.ts +1 -1
- package/dist/deploy/cloudRun/utils/getServiceName.js +3 -1
- package/dist/deploy/cloudRun/utils/jobName.d.ts +2 -1
- package/dist/deploy/cloudRun/utils/jobName.js +4 -2
- package/dist/deploy/cloudRun/utils/removeFirstLinesFromCommandOutput.js +3 -1
- package/dist/deploy/cloudSql/utils.d.ts +2 -1
- package/dist/deploy/cloudSql/utils.js +7 -2
- package/dist/deploy/custom/deployJob.js +3 -1
- package/dist/deploy/custom/index.js +3 -1
- package/dist/deploy/dockerTag/deployJob.js +3 -1
- package/dist/deploy/dockerTag/index.js +3 -1
- package/dist/deploy/index.d.ts +4 -3
- package/dist/deploy/index.js +13 -7
- package/dist/deploy/kubernetes/additionalSecretKeys.js +3 -1
- package/dist/deploy/kubernetes/cloudSql/index.d.ts +3 -2
- package/dist/deploy/kubernetes/cloudSql/index.js +6 -4
- package/dist/deploy/kubernetes/deployJob.js +22 -15
- package/dist/deploy/kubernetes/index.js +51 -14
- package/dist/deploy/kubernetes/kubeEnv.d.ts +3 -2
- package/dist/deploy/kubernetes/kubeEnv.js +7 -4
- package/dist/deploy/kubernetes/kubeValues.d.ts +2 -2
- package/dist/deploy/kubernetes/kubeValues.js +3 -2
- package/dist/deploy/kubernetes/mongodb.js +3 -1
- package/dist/deploy/kubernetes/processSecretsAsFiles.d.ts +2 -1
- package/dist/deploy/kubernetes/processSecretsAsFiles.js +3 -1
- package/dist/deploy/sbom.js +3 -1
- package/dist/deploy/types/base.d.ts +8 -2
- package/dist/deploy/types/base.js +3 -1
- package/dist/deploy/types/custom.d.ts +1 -1
- package/dist/deploy/types/custom.js +3 -1
- package/dist/deploy/types/dockerTag.d.ts +1 -1
- package/dist/deploy/types/dockerTag.js +3 -1
- package/dist/deploy/types/googleCloudRun.d.ts +74 -17
- package/dist/deploy/types/googleCloudRun.js +3 -1
- package/dist/deploy/types/index.d.ts +6 -6
- package/dist/deploy/types/index.js +13 -7
- package/dist/deploy/types/kubernetes.d.ts +22 -22
- package/dist/deploy/types/kubernetes.js +3 -1
- package/dist/deploy/utils.js +3 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +16 -9
- package/dist/packageInfos.d.ts +2 -0
- package/dist/packageInfos.js +14 -0
- package/dist/pipeline/createAllJobs.d.ts +13 -5
- package/dist/pipeline/createAllJobs.js +21 -10
- package/dist/pipeline/createChildPipeline.d.ts +1 -1
- package/dist/pipeline/createChildPipeline.js +30 -63
- package/dist/pipeline/createJobsForComponent.d.ts +3 -3
- package/dist/pipeline/createJobsForComponent.js +19 -18
- package/dist/pipeline/createMainPipeline.d.ts +3 -0
- package/dist/pipeline/createMainPipeline.js +248 -0
- package/dist/pipeline/generatePipelineFiles.d.ts +2 -0
- package/dist/pipeline/generatePipelineFiles.js +178 -0
- package/dist/pipeline/getPipelineStages.d.ts +8 -0
- package/dist/pipeline/getPipelineStages.js +55 -0
- package/dist/pipeline/gitlab/createGitlabJobs.d.ts +15 -6
- package/dist/pipeline/gitlab/createGitlabJobs.js +98 -25
- package/dist/pipeline/gitlab/createGitlabPipeline.d.ts +8 -0
- package/dist/pipeline/gitlab/createGitlabPipeline.js +38 -0
- package/dist/pipeline/gitlab/getPipelineTriggerForGitlabChildPipeline.d.ts +1 -0
- package/dist/pipeline/gitlab/getPipelineTriggerForGitlabChildPipeline.js +29 -0
- package/dist/pipeline/gitlab/gitlabReleaseJobs.d.ts +33 -0
- package/dist/pipeline/gitlab/gitlabReleaseJobs.js +24 -0
- package/dist/pipeline/index.d.ts +3 -1
- package/dist/pipeline/index.js +16 -8
- package/dist/pipeline/packageManager.js +4 -2
- package/dist/pipeline/yarn/yarnUtils.js +6 -4
- package/dist/rules/index.d.ts +7 -2
- package/dist/rules/index.js +34 -16
- package/dist/runner/index.d.ts +1 -1
- package/dist/runner/index.js +3 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/config.d.ts +31 -18
- package/dist/types/config.js +5 -2
- package/dist/types/context.d.ts +37 -32
- package/dist/types/context.js +3 -1
- package/dist/types/environmentContext.d.ts +11 -7
- package/dist/types/environmentContext.js +3 -1
- package/dist/types/gitlab-ci-yml.d.ts +30 -30
- package/dist/types/gitlab-ci-yml.js +3 -2
- package/dist/types/gitlab-types.d.ts +4 -6
- package/dist/types/gitlab-types.js +3 -1
- package/dist/types/index.js +13 -7
- package/dist/types/jobs.d.ts +23 -6
- package/dist/types/jobs.js +3 -1
- package/dist/types/pipeline.d.ts +4 -3
- package/dist/types/pipeline.js +3 -1
- package/dist/types/utils.d.ts +1 -1
- package/dist/types/utils.js +3 -1
- package/dist/utils/gitlab.js +3 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +3 -1
- package/dist/utils/writeFiles.d.ts +7 -0
- package/dist/{pipeline/commitInfo/getBuildId.js → utils/writeFiles.js} +39 -22
- package/examples/__snapshots__/cloud-run-memory-limit.ts.snap +495 -363
- package/examples/__snapshots__/cloud-run-meteor-with-worker.ts.snap +474 -342
- package/examples/__snapshots__/cloud-run-no-cpu-throttling.ts.snap +492 -360
- package/examples/__snapshots__/cloud-run-no-service.ts.snap +2023 -0
- package/examples/__snapshots__/cloud-run-non-public.ts.snap +492 -360
- package/examples/__snapshots__/cloud-run-post-stop-job.ts.snap +501 -368
- package/examples/__snapshots__/cloud-run-service-gen2.ts.snap +1971 -0
- package/examples/__snapshots__/cloud-run-service-with-volumes.ts.snap +2015 -0
- package/examples/__snapshots__/cloud-run-with-ngnix.ts.snap +1971 -0
- package/examples/__snapshots__/cloud-run-with-sql-reuse-db.ts.snap +1167 -867
- package/examples/__snapshots__/cloud-run-with-sql.ts.snap +1155 -867
- package/examples/__snapshots__/cloud-run-with-worker.ts.snap +494 -362
- package/examples/__snapshots__/custom-build-job-with-tests.ts.snap +464 -332
- package/examples/__snapshots__/custom-build-job.ts.snap +446 -326
- package/examples/__snapshots__/custom-deploy.ts.snap +331 -223
- package/examples/__snapshots__/custom-envs.ts.snap +135 -81
- package/examples/__snapshots__/custom-sbom-java.ts.snap +446 -326
- package/examples/__snapshots__/kubernetes-application-customization.ts.snap +858 -969
- package/examples/__snapshots__/kubernetes-with-cloud-sql-legacy.ts.snap +898 -957
- package/examples/__snapshots__/kubernetes-with-cloud-sql.ts.snap +906 -969
- package/examples/__snapshots__/kubernetes-with-jobs.ts.snap +1638 -1728
- package/examples/__snapshots__/kubernetes-with-mongodb.ts.snap +986 -1137
- package/examples/__snapshots__/local-dot-env.ts.snap +1971 -0
- package/examples/__snapshots__/meteor-kubernetes.ts.snap +918 -1069
- package/examples/__snapshots__/multiline-var.ts.snap +4500 -0
- package/examples/__snapshots__/native-app.ts.snap +718 -554
- package/examples/__snapshots__/node-build-with-custom-image.ts.snap +492 -360
- package/examples/__snapshots__/node-build-with-docker-additions.ts.snap +500 -360
- package/examples/__snapshots__/rails-k8s-with-worker.ts.snap +1689 -1947
- package/examples/__snapshots__/wait-for-other-deploy.ts.snap +299 -231
- package/examples/cloud-run-memory-limit.ts +4 -1
- package/examples/cloud-run-no-service.ts +32 -0
- package/examples/cloud-run-service-gen2.ts +27 -0
- package/examples/cloud-run-service-with-volumes.ts +54 -0
- package/examples/cloud-run-with-ngnix.ts +24 -0
- package/examples/custom-deploy.ts +7 -7
- package/examples/local-dot-env.ts +25 -0
- package/examples/multiline-var.ts +64 -0
- package/package.json +5 -7
- package/src/bash/BashExpression.ts +81 -0
- package/src/bash/bashExpressionPerPipelineType.ts +16 -0
- package/src/bash/bashYaml.ts +46 -0
- package/src/bash/getInjectVarsScript.ts +12 -0
- package/src/bash/replaceAsync.ts +50 -0
- package/src/build/base/createAppBuildJob.ts +11 -5
- package/src/build/base/index.ts +1 -1
- package/src/build/base/writeBuildInfo.ts +1 -1
- package/src/build/base/writeDotEnv.ts +6 -1
- package/src/build/custom/buildJob.ts +4 -9
- package/src/build/custom/testJob.ts +3 -2
- package/src/build/docker.ts +62 -17
- package/src/build/node/buildJob.ts +5 -9
- package/src/build/node/meteor.ts +3 -3
- package/src/build/node/testJob.ts +3 -2
- package/src/build/node/yarn.ts +9 -4
- package/src/build/rails/build.ts +1 -0
- package/src/build/rails/test.ts +2 -1
- package/src/build/types.ts +61 -39
- package/src/catladder-gitlab.ts +8 -55
- package/src/config/readConfig.ts +2 -3
- package/src/constants.ts +5 -2
- package/src/context/__tests__/resolveReferences.test.ts +11 -6
- package/src/context/getBuildInfoVariables.ts +40 -0
- package/src/context/getEnvironment.ts +7 -23
- package/src/context/getEnvironmentContext.ts +25 -29
- package/src/context/getEnvironmentVariables.ts +61 -36
- package/src/context/getReviewSlug.ts +27 -0
- package/src/context/index.ts +24 -23
- package/src/context/resolveReferences.ts +29 -9
- package/src/context/transformJobOnlyVars.ts +5 -2
- package/src/context/utils/envVars.ts +2 -1
- package/src/deploy/base/deploy.ts +20 -18
- package/src/deploy/base/rollback.ts +8 -10
- package/src/deploy/base/stop.ts +8 -9
- package/src/deploy/cloudRun/artifactsRegistry.ts +9 -4
- package/src/deploy/cloudRun/createJobs/cloudRunJobs.ts +35 -15
- package/src/deploy/cloudRun/createJobs/cloudRunServices.ts +35 -20
- package/src/deploy/cloudRun/createJobs/common.ts +14 -1
- package/src/deploy/cloudRun/createJobs/constants.ts +1 -0
- package/src/deploy/cloudRun/createJobs/getCloudRunDeployScripts.ts +20 -2
- package/src/deploy/cloudRun/createJobs/index.ts +17 -8
- package/src/deploy/cloudRun/createJobs/volumes.ts +23 -0
- package/src/deploy/cloudRun/index.ts +28 -8
- package/src/deploy/cloudRun/utils/createArgsString.ts +21 -13
- package/src/deploy/cloudRun/utils/database.ts +25 -3
- package/src/deploy/cloudRun/utils/jobName.ts +7 -2
- package/src/deploy/cloudSql/utils.ts +12 -9
- package/src/deploy/index.ts +2 -1
- package/src/deploy/kubernetes/cloudSql/index.ts +3 -2
- package/src/deploy/kubernetes/deployJob.ts +24 -10
- package/src/deploy/kubernetes/index.ts +15 -8
- package/src/deploy/kubernetes/kubeEnv.ts +8 -6
- package/src/deploy/kubernetes/kubeValues.ts +0 -1
- package/src/deploy/kubernetes/processSecretsAsFiles.ts +2 -1
- package/src/deploy/types/base.ts +6 -0
- package/src/deploy/types/googleCloudRun.ts +73 -4
- package/src/index.ts +2 -1
- package/src/packageInfos.ts +10 -0
- package/src/pipeline/createAllJobs.ts +24 -10
- package/src/pipeline/createChildPipeline.ts +19 -30
- package/src/pipeline/createJobsForComponent.ts +14 -22
- package/src/pipeline/createMainPipeline.ts +88 -0
- package/src/pipeline/generatePipelineFiles.ts +29 -0
- package/src/pipeline/getPipelineStages.ts +22 -0
- package/src/pipeline/gitlab/createGitlabJobs.ts +174 -51
- package/src/pipeline/gitlab/createGitlabPipeline.ts +24 -0
- package/src/pipeline/gitlab/getPipelineTriggerForGitlabChildPipeline.ts +46 -0
- package/src/pipeline/gitlab/gitlabReleaseJobs.ts +20 -0
- package/src/pipeline/index.ts +2 -0
- package/src/rules/index.ts +36 -9
- package/src/types/config.ts +24 -4
- package/src/types/context.ts +39 -26
- package/src/types/environmentContext.ts +12 -6
- package/src/types/gitlab-ci-yml.ts +0 -1
- package/src/types/gitlab-types.ts +5 -4
- package/src/types/jobs.ts +28 -3
- package/src/types/pipeline.ts +4 -0
- package/src/utils/writeFiles.ts +40 -0
- package/dist/deploy/cloudRun/createJobs/variables.d.ts +0 -5
- package/dist/deploy/cloudRun/createJobs/variables.js +0 -19
- package/dist/pipeline/commitInfo/getBuildId.d.ts +0 -6
- package/dist/pipeline/commitInfo/getCommitInfo.d.ts +0 -2
- package/src/deploy/cloudRun/createJobs/variables.ts +0 -21
- package/src/pipeline/commitInfo/getBuildId.ts +0 -17
- package/src/pipeline/commitInfo/getCommitInfo.ts +0 -15
package/dist/build/rails/test.js
CHANGED
|
@@ -41,18 +41,21 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
|
|
|
41
41
|
}
|
|
42
42
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
43
43
|
};
|
|
44
|
-
exports
|
|
44
|
+
Object.defineProperty(exports, "__esModule", {
|
|
45
|
+
value: true
|
|
46
|
+
});
|
|
45
47
|
exports.createRailsTestJobs = void 0;
|
|
46
48
|
var utils_1 = require("../../utils");
|
|
47
49
|
var createRailsTestJobs = function (context) {
|
|
48
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r
|
|
50
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
49
51
|
// don't run tests after release
|
|
50
|
-
|
|
52
|
+
// TODO: this will be replaced by using rules
|
|
53
|
+
if (context.trigger === "taggedRelease") {
|
|
51
54
|
return [];
|
|
52
55
|
}
|
|
53
56
|
var buildConfig = context.componentConfig.build;
|
|
54
57
|
var base = {
|
|
55
|
-
variables: __assign(__assign({}, context.environment.jobOnlyVars.build.envVars), (
|
|
58
|
+
variables: __assign(__assign({}, context.environment.jobOnlyVars.build.envVars), (_a = buildConfig.extraVars) !== null && _a !== void 0 ? _a : {}),
|
|
56
59
|
stage: "test",
|
|
57
60
|
needs: [],
|
|
58
61
|
envMode: "none"
|
|
@@ -63,31 +66,32 @@ var createRailsTestJobs = function (context) {
|
|
|
63
66
|
var bundlerCache = {
|
|
64
67
|
key: {
|
|
65
68
|
files: ["Gemfile.lock"],
|
|
66
|
-
prefix: "$CI_JOB_IMAGE"
|
|
69
|
+
prefix: "$CI_JOB_IMAGE" // a changed image might have different OS libraries which no longer work with the cached gems
|
|
67
70
|
},
|
|
71
|
+
|
|
68
72
|
paths: [bundlerCacheDir]
|
|
69
73
|
};
|
|
70
74
|
var auditJob = buildConfig.audit !== false ? __assign(__assign({
|
|
71
75
|
name: "🛡 audit"
|
|
72
76
|
}, base), {
|
|
73
77
|
cache: undefined,
|
|
74
|
-
image: (
|
|
75
|
-
script: __spreadArray(["cd ".concat(context.componentConfig.dir)], __read((
|
|
78
|
+
image: (_d = (_c = (_b = buildConfig.audit) === null || _b === void 0 ? void 0 : _b.jobImage) !== null && _c !== void 0 ? _c : buildConfig.jobImage) !== null && _d !== void 0 ? _d : defaultImage,
|
|
79
|
+
script: __spreadArray(["cd ".concat(context.componentConfig.dir)], __read((_f = (0, utils_1.ensureArray)((_e = buildConfig.audit) === null || _e === void 0 ? void 0 : _e.command)) !== null && _f !== void 0 ? _f : ["gem install bundler-audit", "bundle audit check"]), false),
|
|
76
80
|
allow_failure: true
|
|
77
81
|
}) : null;
|
|
78
82
|
var lintJob = buildConfig.lint !== false ? __assign(__assign({
|
|
79
83
|
name: "👮 lint"
|
|
80
84
|
}, base), {
|
|
81
85
|
cache: bundlerCache,
|
|
82
|
-
image: (
|
|
83
|
-
script: __spreadArray(__spreadArray(["cd ".concat(context.componentConfig.dir)], __read(bundlerInstall), false), __read((
|
|
86
|
+
image: (_j = (_h = (_g = buildConfig.lint) === null || _g === void 0 ? void 0 : _g.jobImage) !== null && _h !== void 0 ? _h : buildConfig.jobImage) !== null && _j !== void 0 ? _j : defaultImage,
|
|
87
|
+
script: __spreadArray(__spreadArray(["cd ".concat(context.componentConfig.dir)], __read(bundlerInstall), false), __read((_l = (0, utils_1.ensureArray)((_k = buildConfig.lint) === null || _k === void 0 ? void 0 : _k.command)) !== null && _l !== void 0 ? _l : ["bundle exec rubocop"]), false)
|
|
84
88
|
}) : null;
|
|
85
89
|
var testJob = buildConfig.test !== false ? __assign(__assign({
|
|
86
90
|
name: "🧪 test"
|
|
87
91
|
}, base), {
|
|
88
92
|
cache: bundlerCache,
|
|
89
|
-
image: (
|
|
90
|
-
script: __spreadArray(__spreadArray(["cd ".concat(context.componentConfig.dir)], __read(bundlerInstall), false), __read((
|
|
93
|
+
image: (_p = (_o = (_m = buildConfig.test) === null || _m === void 0 ? void 0 : _m.jobImage) !== null && _o !== void 0 ? _o : buildConfig.jobImage) !== null && _p !== void 0 ? _p : defaultImage,
|
|
94
|
+
script: __spreadArray(__spreadArray(["cd ".concat(context.componentConfig.dir)], __read(bundlerInstall), false), __read((_r = (0, utils_1.ensureArray)((_q = buildConfig.test) === null || _q === void 0 ? void 0 : _q.command)) !== null && _r !== void 0 ? _r : ["bundle exec rspec"]), false)
|
|
91
95
|
}) : null;
|
|
92
96
|
return [auditJob, lintJob, testJob].filter(utils_1.notNil);
|
|
93
97
|
};
|
package/dist/build/sbom.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
exports
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
4
6
|
exports.createSbomBuildJob = exports.SBOM_FILE = exports.SBOM_BUILD_JOB_NAME = void 0;
|
|
5
7
|
var utils_1 = require("../utils");
|
|
6
8
|
exports.SBOM_BUILD_JOB_NAME = "🧾 sbom";
|
package/dist/build/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Artifacts, EnvVars, GitlabJobImage } from "../types";
|
|
2
2
|
import type { Services } from "../types/gitlab-ci-yml";
|
|
3
3
|
import type { CatladderJob } from "../types/jobs";
|
|
4
|
-
export
|
|
4
|
+
export type BuildConfigArtifactsReports = {
|
|
5
5
|
/**
|
|
6
6
|
* The junit report collects JUnit report format XML files.
|
|
7
7
|
* The collected Unit test reports upload to GitLab as an artifact.
|
|
@@ -10,7 +10,7 @@ export declare type BuildConfigArtifactsReports = {
|
|
|
10
10
|
*/
|
|
11
11
|
junit?: string[];
|
|
12
12
|
};
|
|
13
|
-
export
|
|
13
|
+
export type TestJobCustom = {
|
|
14
14
|
command?: string | string[];
|
|
15
15
|
jobImage?: GitlabJobImage;
|
|
16
16
|
/**
|
|
@@ -25,7 +25,7 @@ export declare type TestJobCustom = {
|
|
|
25
25
|
*/
|
|
26
26
|
artifacts?: Artifacts;
|
|
27
27
|
};
|
|
28
|
-
export
|
|
28
|
+
export type BuildConfigBase = {
|
|
29
29
|
/**
|
|
30
30
|
* command to run on the image to start the app (e.g. yarn start)
|
|
31
31
|
*/
|
|
@@ -38,34 +38,19 @@ export declare type BuildConfigBase = {
|
|
|
38
38
|
/**
|
|
39
39
|
* additional env vars for the buid jobs
|
|
40
40
|
*
|
|
41
|
-
* @deprecated use jobVars
|
|
41
|
+
* @deprecated use jobVars or runnerVariables
|
|
42
42
|
*/
|
|
43
43
|
extraVars?: Record<string, string>;
|
|
44
44
|
/**
|
|
45
|
-
*
|
|
45
|
+
* additional vars only for the runner.
|
|
46
|
+
* Also if you use services: that require env vars, you need to set them here.
|
|
47
|
+
*
|
|
46
48
|
*/
|
|
47
|
-
|
|
49
|
+
runnerVariables?: Record<string, string>;
|
|
48
50
|
/**
|
|
49
|
-
*
|
|
51
|
+
* define the build command
|
|
50
52
|
*/
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Custom Dockerfile lines integrated in the generated Dockerfile before the standard build steps.
|
|
54
|
-
*
|
|
55
|
-
* - [runner-images/docker-build/scripts/ensureNodeDockerfile](https://git.panter.ch/catladder/catladder/-/tree/main/runner-images/docker-build/scripts/ensureNodeDockerfile)
|
|
56
|
-
* - [runner-images/docker-build/scripts/ensureNginxDockerfile](https://git.panter.ch/catladder/catladder/-/tree/main/runner-images/docker-build/scripts/ensureNginxDockerfile)
|
|
57
|
-
* - [runner-images/docker-build/scripts/ensureMeteorDockerfile](https://git.panter.ch/catladder/catladder/-/tree/main/runner-images/docker-build/scripts/ensureMeteorDockerfile)
|
|
58
|
-
*/
|
|
59
|
-
additionsBegin?: string[];
|
|
60
|
-
/**
|
|
61
|
-
* Custom Dockerfile lines integrated in the generated Dockerfile after the standard build steps.
|
|
62
|
-
*
|
|
63
|
-
* - [runner-images/docker-build/scripts/ensureNodeDockerfile](https://git.panter.ch/catladder/catladder/-/tree/main/runner-images/docker-build/scripts/ensureNodeDockerfile)
|
|
64
|
-
* - [runner-images/docker-build/scripts/ensureNginxDockerfile](https://git.panter.ch/catladder/catladder/-/tree/main/runner-images/docker-build/scripts/ensureNginxDockerfile)
|
|
65
|
-
* - [runner-images/docker-build/scripts/ensureMeteorDockerfile](https://git.panter.ch/catladder/catladder/-/tree/main/runner-images/docker-build/scripts/ensureMeteorDockerfile)
|
|
66
|
-
*/
|
|
67
|
-
additionsEnd?: string[];
|
|
68
|
-
};
|
|
53
|
+
buildCommand?: string | string[] | null;
|
|
69
54
|
/**
|
|
70
55
|
* customize lint, set false to disable
|
|
71
56
|
*/
|
|
@@ -101,47 +86,75 @@ export declare type BuildConfigBase = {
|
|
|
101
86
|
*/
|
|
102
87
|
jobImage?: GitlabJobImage;
|
|
103
88
|
};
|
|
104
|
-
export
|
|
89
|
+
export type BuildConfigNodeBase = BuildConfigBase & {
|
|
105
90
|
/**
|
|
106
91
|
* runs a command after yarn install. postinstall in package.json won't work for yarn plug and play.
|
|
107
92
|
* the command will be invoked in the component dir.
|
|
108
93
|
*/
|
|
109
94
|
postInstall?: string | string[];
|
|
110
95
|
};
|
|
111
|
-
export
|
|
96
|
+
export type BuildConfigNode = {
|
|
112
97
|
type: "node";
|
|
98
|
+
docker?: Omit<BuildConfigDockerBuiltInNode, "type"> | BuildConfigDocker;
|
|
113
99
|
} & BuildConfigNodeBase;
|
|
114
|
-
export
|
|
100
|
+
export type BuildConfigNodeStatic = BuildConfigNodeBase & {
|
|
115
101
|
type: "node-static";
|
|
116
102
|
startCommand?: never;
|
|
103
|
+
docker?: Omit<BuildConfigDockerBuiltInNgninx, "type"> | BuildConfigDocker;
|
|
117
104
|
};
|
|
118
|
-
export
|
|
105
|
+
export type BuildConfigMeteor = BuildConfigNodeBase & {
|
|
119
106
|
type: "meteor";
|
|
120
107
|
/**
|
|
121
108
|
* whether to run yarn install inside the source folder in the docker image.
|
|
122
109
|
* This is only required if you have custom scripts in your image
|
|
123
110
|
*/
|
|
124
111
|
installScripts?: boolean;
|
|
112
|
+
docker?: Omit<BuildConfigDockerBuiltInMeteor, "type"> | BuildConfigDocker;
|
|
125
113
|
};
|
|
126
|
-
|
|
114
|
+
type BuildConfigDockerWithAdditions = {
|
|
115
|
+
/**
|
|
116
|
+
* Custom Dockerfile lines integrated in the generated Dockerfile before the standard build steps.
|
|
117
|
+
*
|
|
118
|
+
*/
|
|
119
|
+
additionsBegin?: string[];
|
|
120
|
+
/**
|
|
121
|
+
* Custom Dockerfile lines integrated in the generated Dockerfile after the standard build steps.
|
|
122
|
+
*
|
|
123
|
+
*/
|
|
124
|
+
additionsEnd?: string[];
|
|
125
|
+
};
|
|
126
|
+
type BuildConfigDockerBuiltInNode = {
|
|
127
|
+
type: "node";
|
|
128
|
+
} & BuildConfigDockerWithAdditions;
|
|
129
|
+
type BuildConfigDockerBuiltInMeteor = {
|
|
130
|
+
type: "meteor";
|
|
131
|
+
} & BuildConfigDockerWithAdditions;
|
|
132
|
+
type BuildConfigDockerBuiltInNgninx = {
|
|
127
133
|
/**
|
|
128
134
|
* use the built-in nginx image for simple static apps
|
|
129
135
|
*/
|
|
130
136
|
type: "nginx";
|
|
131
|
-
}
|
|
137
|
+
} & BuildConfigDockerWithAdditions;
|
|
138
|
+
type BuildConfigDockerBuiltIn = BuildConfigDockerBuiltInNgninx | BuildConfigDockerBuiltInNode | BuildConfigDockerBuiltInMeteor;
|
|
139
|
+
type BuildConfigDockerCustom = {
|
|
132
140
|
/**
|
|
133
141
|
* custom docker build, expect that a Dockerfile in your directory
|
|
134
142
|
*/
|
|
135
143
|
type: "custom";
|
|
136
|
-
}
|
|
137
|
-
export
|
|
144
|
+
};
|
|
145
|
+
export type BuildConfigDocker = BuildConfigDockerBuiltIn | BuildConfigDockerCustom;
|
|
146
|
+
/**
|
|
147
|
+
* @deprecated this type is no longer used. Use {@link BuildConfigDocker} instead.
|
|
148
|
+
*/
|
|
149
|
+
export type BuildConfigCustomDocker = BuildConfigDockerCustom | BuildConfigDockerBuiltInNgninx;
|
|
150
|
+
export type BuildConfigCustom = Omit<BuildConfigBase, "lint" | "test" | "audit"> & {
|
|
138
151
|
type: "custom";
|
|
139
152
|
jobImage: GitlabJobImage;
|
|
140
153
|
/**
|
|
141
154
|
* {@link Services}s used in lint, test, audit, and build jobs.
|
|
142
155
|
*/
|
|
143
156
|
jobServices?: Services;
|
|
144
|
-
docker:
|
|
157
|
+
docker: BuildConfigDocker;
|
|
145
158
|
/**
|
|
146
159
|
* custom lint, disabled when not set
|
|
147
160
|
*/
|
|
@@ -165,7 +178,7 @@ export declare type BuildConfigCustom = Omit<BuildConfigBase, "lint" | "test" |
|
|
|
165
178
|
jobImage: GitlabJobImage;
|
|
166
179
|
};
|
|
167
180
|
};
|
|
168
|
-
export
|
|
181
|
+
export type BuildConfigRails = BuildConfigBase & {
|
|
169
182
|
type: "rails";
|
|
170
183
|
/**
|
|
171
184
|
* The [Cloud Native Buildpacks](https://buildpacks.io/) builder configuration.
|
|
@@ -200,25 +213,26 @@ export declare type BuildConfigRails = BuildConfigBase & {
|
|
|
200
213
|
buildVars?: Record<string, string | undefined>;
|
|
201
214
|
};
|
|
202
215
|
};
|
|
203
|
-
export
|
|
216
|
+
export type BuildConfigStorybook = BuildConfigNodeBase & {
|
|
204
217
|
type: "storybook";
|
|
205
218
|
startCommand?: never;
|
|
206
219
|
};
|
|
207
|
-
export
|
|
208
|
-
export
|
|
209
|
-
export
|
|
220
|
+
export type BuildConfig = BuildConfigNode | BuildConfigNodeStatic | BuildConfigStorybook | BuildConfigMeteor | BuildConfigCustom | BuildConfigRails;
|
|
221
|
+
export type BuildConfigType = BuildConfig["type"];
|
|
222
|
+
export type BuildConfigGeneric<T extends BuildConfigType> = Extract<BuildConfig, {
|
|
210
223
|
type: T;
|
|
211
224
|
}>;
|
|
212
|
-
export declare const isOfBuildType: <T extends ("node" | "node-static" | "
|
|
225
|
+
export declare const isOfBuildType: <T extends ("node" | "node-static" | "storybook" | "meteor" | "custom" | "rails")[]>(t: BuildConfig, ...types: T) => t is Extract<BuildConfigNode, {
|
|
213
226
|
type: T[number];
|
|
214
227
|
}> | Extract<BuildConfigNodeStatic, {
|
|
215
228
|
type: T[number];
|
|
229
|
+
}> | Extract<BuildConfigStorybook, {
|
|
230
|
+
type: T[number];
|
|
216
231
|
}> | Extract<BuildConfigMeteor, {
|
|
217
232
|
type: T[number];
|
|
218
233
|
}> | Extract<BuildConfigCustom, {
|
|
219
234
|
type: T[number];
|
|
220
235
|
}> | Extract<BuildConfigRails, {
|
|
221
236
|
type: T[number];
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
}>;
|
|
237
|
+
}>;
|
|
238
|
+
export {};
|