@catladder/pipeline 0.0.0-refactor-docker-9fda97e9 → 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.
Files changed (169) hide show
  1. package/dist/build/base/createAppBuildJob.d.ts +2 -2
  2. package/dist/build/base/createAppBuildJob.js +1 -1
  3. package/dist/build/base/index.d.ts +2 -2
  4. package/dist/build/base/writeBuildInfo.d.ts +2 -2
  5. package/dist/build/base/writeDotEnv.d.ts +2 -2
  6. package/dist/build/custom/buildJob.d.ts +2 -2
  7. package/dist/build/custom/index.d.ts +2 -2
  8. package/dist/build/custom/testJob.d.ts +2 -2
  9. package/dist/build/docker.d.ts +11 -11
  10. package/dist/build/docker.js +6 -6
  11. package/dist/build/index.d.ts +2 -2
  12. package/dist/build/node/buildJob.d.ts +2 -2
  13. package/dist/build/node/buildJob.js +7 -7
  14. package/dist/build/node/cache.d.ts +5 -5
  15. package/dist/build/node/cache.js +4 -4
  16. package/dist/build/node/index.d.ts +4 -4
  17. package/dist/build/node/meteor.d.ts +2 -2
  18. package/dist/build/node/meteor.js +2 -2
  19. package/dist/build/node/testJob.d.ts +2 -2
  20. package/dist/build/node/testJob.js +6 -6
  21. package/dist/build/node/yarn.d.ts +4 -4
  22. package/dist/build/node/yarn.js +1 -1
  23. package/dist/build/rails/build.d.ts +2 -2
  24. package/dist/build/rails/index.d.ts +2 -2
  25. package/dist/build/rails/test.d.ts +2 -2
  26. package/dist/build/sbom.d.ts +2 -2
  27. package/dist/build/sbom.js +1 -1
  28. package/dist/bundles/catladder-gitlab/index.js +61 -46
  29. package/dist/constants.js +1 -1
  30. package/dist/context/getEnvironment.d.ts +2 -2
  31. package/dist/context/getEnvironmentContext.d.ts +2 -2
  32. package/dist/context/getEnvironmentVariables.d.ts +4 -4
  33. package/dist/context/getEnvironmentVariables.js +1 -2
  34. package/dist/context/getLabels.d.ts +2 -2
  35. package/dist/context/index.d.ts +7 -3
  36. package/dist/context/index.js +12 -3
  37. package/dist/deploy/base/deploy.d.ts +2 -2
  38. package/dist/deploy/base/index.d.ts +2 -2
  39. package/dist/deploy/base/rollback.d.ts +2 -2
  40. package/dist/deploy/base/stop.d.ts +2 -2
  41. package/dist/deploy/cloudRun/artifactsRegistry.d.ts +7 -7
  42. package/dist/deploy/cloudRun/cleanup.d.ts +2 -2
  43. package/dist/deploy/cloudRun/cloudRunRevisions.d.ts +2 -2
  44. package/dist/deploy/cloudRun/createJobs/cloudRunJobs.d.ts +6 -6
  45. package/dist/deploy/cloudRun/createJobs/cloudRunServices.d.ts +3 -3
  46. package/dist/deploy/cloudRun/createJobs/common.d.ts +4 -4
  47. package/dist/deploy/cloudRun/createJobs/getCloudRunDeployScripts.d.ts +2 -2
  48. package/dist/deploy/cloudRun/createJobs/getCloudRunDeployScripts.js +1 -2
  49. package/dist/deploy/cloudRun/createJobs/getCloudRunStopScripts.d.ts +2 -2
  50. package/dist/deploy/cloudRun/createJobs/index.d.ts +2 -2
  51. package/dist/deploy/cloudRun/utils/database.d.ts +3 -3
  52. package/dist/deploy/cloudRun/utils/gcloudServiceAccountLoginCommands.d.ts +2 -2
  53. package/dist/deploy/cloudRun/utils/getServiceName.d.ts +2 -2
  54. package/dist/deploy/custom/deployJob.d.ts +2 -2
  55. package/dist/deploy/custom/deployJob.js +1 -1
  56. package/dist/deploy/dockerTag/deployJob.d.ts +2 -2
  57. package/dist/deploy/index.d.ts +2 -2
  58. package/dist/deploy/kubernetes/cloudSql/index.d.ts +3 -3
  59. package/dist/deploy/kubernetes/deployJob.d.ts +2 -2
  60. package/dist/deploy/kubernetes/kubeEnv.d.ts +2 -2
  61. package/dist/deploy/kubernetes/kubeValues.d.ts +2 -2
  62. package/dist/deploy/kubernetes/kubeValues.js +1 -3
  63. package/dist/deploy/kubernetes/mongodb.d.ts +2 -2
  64. package/dist/deploy/sbom.d.ts +4 -4
  65. package/dist/deploy/utils.d.ts +2 -2
  66. package/dist/pipeline/createJobsForComponent.d.ts +2 -2
  67. package/dist/pipeline/createJobsForComponent.js +1 -1
  68. package/dist/pipeline/generatePipelineFiles.js +15 -5
  69. package/dist/tsconfig.tsbuildinfo +1 -1
  70. package/dist/types/config.d.ts +3 -3
  71. package/dist/types/context.d.ts +16 -2
  72. package/dist/types/jobs.d.ts +1 -1
  73. package/examples/__snapshots__/cloud-run-storybook.ts.snap +1687 -0
  74. package/examples/__utils__/helpers.ts +2 -2
  75. package/examples/cloud-run-storybook.ts +24 -0
  76. package/package.json +1 -1
  77. package/scripts/generate-gitlab-ci-types.ts +2 -2
  78. package/src/bash/BashExpression.ts +4 -4
  79. package/src/bash/bashExpressionPerPipelineType.ts +1 -1
  80. package/src/bash/replaceAsync.ts +4 -4
  81. package/src/build/base/__tests__/createArtifactsConfig.test.ts +3 -3
  82. package/src/build/base/createAppBuildJob.ts +3 -3
  83. package/src/build/base/createArtifactsConfig.ts +2 -2
  84. package/src/build/base/index.ts +2 -2
  85. package/src/build/base/writeBuildInfo.ts +2 -2
  86. package/src/build/base/writeDotEnv.ts +3 -3
  87. package/src/build/custom/__tests__/testJob.test.ts +6 -6
  88. package/src/build/custom/buildJob.ts +4 -2
  89. package/src/build/custom/index.ts +2 -2
  90. package/src/build/custom/testJob.ts +7 -5
  91. package/src/build/docker.ts +18 -18
  92. package/src/build/index.ts +3 -3
  93. package/src/build/node/buildJob.ts +16 -10
  94. package/src/build/node/cache.ts +13 -13
  95. package/src/build/node/index.ts +6 -4
  96. package/src/build/node/meteor.ts +10 -5
  97. package/src/build/node/testJob.ts +14 -11
  98. package/src/build/node/yarn.ts +13 -15
  99. package/src/build/rails/build.ts +4 -2
  100. package/src/build/rails/index.ts +2 -2
  101. package/src/build/rails/test.ts +4 -2
  102. package/src/build/sbom.ts +4 -4
  103. package/src/config/configruedEnvs.ts +6 -6
  104. package/src/config/readConfig.ts +2 -2
  105. package/src/context/__tests__/resolveReferences.test.ts +1 -1
  106. package/src/context/getBuildInfoVariables.ts +5 -5
  107. package/src/context/getEnvConfig.ts +1 -1
  108. package/src/context/getEnvType.ts +1 -1
  109. package/src/context/getEnvironment.ts +2 -2
  110. package/src/context/getEnvironmentContext.ts +4 -4
  111. package/src/context/getEnvironmentVariables.ts +19 -16
  112. package/src/context/getLabels.ts +2 -2
  113. package/src/context/getReviewSlug.ts +2 -2
  114. package/src/context/index.ts +17 -7
  115. package/src/context/resolveReferences.ts +12 -9
  116. package/src/context/transformJobOnlyVars.ts +1 -1
  117. package/src/context/utils/envVars.ts +3 -3
  118. package/src/deploy/base/deploy.ts +7 -7
  119. package/src/deploy/base/index.ts +3 -3
  120. package/src/deploy/base/rollback.ts +3 -3
  121. package/src/deploy/base/stop.ts +3 -3
  122. package/src/deploy/cloudRun/artifactsRegistry.ts +17 -12
  123. package/src/deploy/cloudRun/cleanup.ts +5 -5
  124. package/src/deploy/cloudRun/cloudRunRevisions.ts +6 -6
  125. package/src/deploy/cloudRun/createJobs/cloudRunJobs.ts +20 -20
  126. package/src/deploy/cloudRun/createJobs/cloudRunServices.ts +7 -7
  127. package/src/deploy/cloudRun/createJobs/common.ts +5 -5
  128. package/src/deploy/cloudRun/createJobs/getCloudRunDeployScripts.ts +12 -9
  129. package/src/deploy/cloudRun/createJobs/getCloudRunStopScripts.ts +3 -3
  130. package/src/deploy/cloudRun/createJobs/index.ts +2 -2
  131. package/src/deploy/cloudRun/createJobs/volumes.ts +2 -2
  132. package/src/deploy/cloudRun/index.ts +10 -6
  133. package/src/deploy/cloudRun/utils/createArgsString.ts +1 -1
  134. package/src/deploy/cloudRun/utils/database.ts +8 -8
  135. package/src/deploy/cloudRun/utils/gcloudServiceAccountLoginCommands.ts +5 -3
  136. package/src/deploy/cloudRun/utils/getServiceName.ts +2 -2
  137. package/src/deploy/cloudRun/utils/jobName.ts +1 -1
  138. package/src/deploy/cloudRun/utils/removeFirstLinesFromCommandOutput.ts +1 -1
  139. package/src/deploy/cloudSql/utils.ts +2 -2
  140. package/src/deploy/custom/deployJob.ts +7 -3
  141. package/src/deploy/dockerTag/deployJob.ts +4 -2
  142. package/src/deploy/index.ts +5 -5
  143. package/src/deploy/kubernetes/cloudSql/index.ts +5 -5
  144. package/src/deploy/kubernetes/deployJob.ts +7 -7
  145. package/src/deploy/kubernetes/index.ts +1 -1
  146. package/src/deploy/kubernetes/kubeEnv.ts +3 -3
  147. package/src/deploy/kubernetes/kubeValues.ts +8 -8
  148. package/src/deploy/kubernetes/mongodb.ts +9 -9
  149. package/src/deploy/kubernetes/processSecretsAsFiles.ts +3 -3
  150. package/src/deploy/sbom.ts +8 -4
  151. package/src/deploy/utils.ts +4 -4
  152. package/src/pipeline/createAllJobs.ts +4 -4
  153. package/src/pipeline/createChildPipeline.ts +2 -2
  154. package/src/pipeline/createJobsForComponent.ts +13 -9
  155. package/src/pipeline/createMainPipeline.ts +20 -17
  156. package/src/pipeline/generatePipelineFiles.ts +21 -12
  157. package/src/pipeline/getPipelineStages.ts +1 -1
  158. package/src/pipeline/gitlab/createGitlabJobs.ts +26 -26
  159. package/src/pipeline/gitlab/getPipelineTriggerForGitlabChildPipeline.ts +6 -6
  160. package/src/pipeline/packageManager.ts +2 -2
  161. package/src/pipeline/yarn/yarnUtils.ts +7 -7
  162. package/src/types/config.ts +4 -4
  163. package/src/types/context.ts +19 -3
  164. package/src/types/environmentContext.ts +1 -1
  165. package/src/types/jobs.ts +1 -1
  166. package/src/types/utils.ts +4 -4
  167. package/src/utils/gitlab.ts +1 -1
  168. package/src/utils/index.ts +2 -2
  169. package/src/utils/writeFiles.ts +2 -2
@@ -23269,7 +23269,7 @@ var createAppBuildJob = function (context, _a) {
23269
23269
  variables: __assign(__assign(__assign(__assign({}, variables !== null && variables !== void 0 ? variables : {}), context.environment.envVars), context.environment.jobOnlyVars.build.envVars), (_b = context.componentConfig.build.extraVars) !== null && _b !== void 0 ? _b : {}),
23270
23270
  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 : {}),
23271
23271
  script: __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(context.componentConfig.dotEnv === true // don't build when set to `local`
23272
- ? (0, writeDotEnv_1.writeDotEnv)(context) : []), false), __read((0, writeBuildInfo_1.writeBuildInfo)(context)), false), __read((0, yarn_1.ensureNodeVersion)(context)), false), ["cd ".concat(context.componentConfig.dir)], false), __read((_d = (0, utils_1.ensureArray)(script)) !== null && _d !== void 0 ? _d : []), false),
23272
+ ? (0, writeDotEnv_1.writeDotEnv)(context) : []), false), __read((0, writeBuildInfo_1.writeBuildInfo)(context)), false), __read((0, yarn_1.ensureNodeVersion)(context.buildContext)), false), ["cd ".concat(context.componentConfig.dir)], false), __read((_d = (0, utils_1.ensureArray)(script)) !== null && _d !== void 0 ? _d : []), false),
23273
23273
  artifacts: {
23274
23274
  paths: [(0, path_1.join)(context.componentConfig.dir, "__build_info.json")],
23275
23275
  reports: {
@@ -23800,14 +23800,14 @@ Object.defineProperty(exports, "__esModule", ({
23800
23800
  value: true
23801
23801
  }));
23802
23802
  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;
23803
- var lodash_1 = __nccwpck_require__(3255);
23804
- var deploy_1 = __nccwpck_require__(1264);
23805
- var runner_1 = __nccwpck_require__(7666);
23806
23803
  var fs_1 = __nccwpck_require__(7147);
23804
+ var lodash_1 = __nccwpck_require__(3255);
23807
23805
  var path_1 = __importDefault(__nccwpck_require__(1017));
23808
- var gitlab_1 = __nccwpck_require__(9818);
23806
+ var deploy_1 = __nccwpck_require__(1264);
23809
23807
  var artifactsRegistry_1 = __nccwpck_require__(998);
23810
23808
  var gcloudServiceAccountLoginCommands_1 = __nccwpck_require__(818);
23809
+ var runner_1 = __nccwpck_require__(7666);
23810
+ var gitlab_1 = __nccwpck_require__(9818);
23811
23811
  var DOCKER_BUILD_RUNNER_REQUESTS = {
23812
23812
  KUBERNETES_CPU_REQUEST: "0.5",
23813
23813
  KUBERNETES_MEMORY_REQUEST: "1Gi",
@@ -23859,8 +23859,8 @@ var getDockerAdditions = function (build) {
23859
23859
  };
23860
23860
  };
23861
23861
  var getDockerBuildVariables = function (context) {
23862
- return __assign(__assign(__assign({}, getDockerAdditions(context.componentConfig.build)), {
23863
- APP_DIR: context.componentConfig.dir,
23862
+ return __assign(__assign(__assign({}, getDockerAdditions(context.buildContext.config)), {
23863
+ APP_DIR: context.buildContext.dir,
23864
23864
  DOCKER_DIR: "."
23865
23865
  }), (0, exports.getDockerImageVariables)(context));
23866
23866
  };
@@ -24069,15 +24069,15 @@ var createNodeBuildJobs = function (context) {
24069
24069
  throw new Error("deploy config is not node, node-static or storybook");
24070
24070
  }
24071
24071
  var defaultImage = (0, runner_1.getRunnerImage)("jobs-default");
24072
- var yarnInstall = (0, yarn_1.getYarnInstall)(context);
24072
+ var yarnInstall = (0, yarn_1.getYarnInstall)(context.buildContext);
24073
24073
  return (0, base_1.createBuildJobs)(context, {
24074
24074
  appBuild: buildConfig.buildCommand !== null ? {
24075
24075
  image: (_a = buildConfig.jobImage) !== null && _a !== void 0 ? _a : defaultImage,
24076
24076
  runnerVariables: constants_1.NODE_RUNNER_BUILD_VARIABLES,
24077
- 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),
24077
+ 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),
24078
24078
  script: __spreadArray(__spreadArray([], __read(yarnInstall), false), __read((_c = (0, utils_1.ensureArray)(buildConfig.buildCommand)) !== null && _c !== void 0 ? _c : []), false),
24079
24079
  artifacts: {
24080
- paths: __spreadArray([context.componentConfig.dir], __read((_e = (_d = context.packageManagerInfo) === null || _d === void 0 ? void 0 : _d.currentWorkspaceDependencies) !== null && _e !== void 0 ? _e : []), false).flatMap(function (dir) {
24080
+ paths: __spreadArray([context.componentConfig.dir], __read((_e = (_d = context.buildContext.packageManagerInfo) === null || _d === void 0 ? void 0 : _d.currentWorkspaceDependencies) !== null && _e !== void 0 ? _e : []), false).flatMap(function (dir) {
24081
24081
  var _a, _b;
24082
24082
  return __spreadArray([(0, path_1.join)(dir, "__build_info.json"), (0, path_1.join)(dir, "dist"), (0, path_1.join)(dir, ".next")], __read((_b = (_a = buildConfig.artifactsPaths) === null || _a === void 0 ? void 0 : _a.map(function (path) {
24083
24083
  return (0, path_1.join)(dir, path);
@@ -24089,12 +24089,12 @@ var createNodeBuildJobs = function (context) {
24089
24089
  jobTags: buildConfig.jobTags
24090
24090
  } : undefined,
24091
24091
  dockerBuild: {
24092
- script: (0, docker_1.getDockerBuildScriptWithBuiltInDockerFile)(context, buildConfig.type === "node-static" ? "nginx" : "node"),
24093
- cache: __spreadArray([], __read((0, cache_1.getYarnCache)(context, "pull")), false),
24092
+ script: (0, docker_1.getDockerBuildScriptWithBuiltInDockerFile)(context, buildConfig.type === "node-static" || buildConfig.type === "storybook" ? "nginx" : "node"),
24093
+ cache: __spreadArray([], __read((0, cache_1.getYarnCache)(context.buildContext, "pull")), false),
24094
24094
  variables: {
24095
24095
  // only required for non static
24096
- DOCKER_COPY_AND_INSTALL_APP: (0, yarn_1.getDockerAppCopyAndBuildScript)(context),
24097
- DOCKER_COPY_WORKSPACE_FILES: (_g = (_f = context.packageManagerInfo) === null || _f === void 0 ? void 0 : _f.pathsToCopyInDocker.map(function (dir) {
24096
+ DOCKER_COPY_AND_INSTALL_APP: (0, yarn_1.getDockerAppCopyAndBuildScript)(context.buildContext),
24097
+ DOCKER_COPY_WORKSPACE_FILES: (_g = (_f = context.buildContext.packageManagerInfo) === null || _f === void 0 ? void 0 : _f.pathsToCopyInDocker.map(function (dir) {
24098
24098
  return "COPY --chown=node:node ".concat(dir, " /app/").concat(dir);
24099
24099
  })) === null || _g === void 0 ? void 0 : _g.join("\n")
24100
24100
  }
@@ -24165,9 +24165,9 @@ var getYarnCache = function (context, policy) {
24165
24165
  policy: policy,
24166
24166
  paths: [".yarn"]
24167
24167
  } : {
24168
- key: (0, slugify_1.default)(context.componentConfig.dir) + "-yarn",
24168
+ key: (0, slugify_1.default)(context.dir) + "-yarn",
24169
24169
  policy: policy,
24170
- paths: [(0, path_1.join)(context.componentConfig.dir, ".yarn")]
24170
+ paths: [(0, path_1.join)(context.dir, ".yarn")]
24171
24171
  }];
24172
24172
  };
24173
24173
  exports.getYarnCache = getYarnCache;
@@ -24181,12 +24181,12 @@ var getNodeModulesCache = function (context, policy) {
24181
24181
  // It would slow down all pipelines whenever one adds a new dependency as it will need to download all node_modules again.
24182
24182
  return [{
24183
24183
  // if component is in a shared workspace, use workspace cache. use individual cache else
24184
- key: componentIsInWorkspace ? "node-modules-workspace" : (0, slugify_1.default)(context.componentConfig.dir) + "-node-modules",
24184
+ key: componentIsInWorkspace ? "node-modules-workspace" : (0, slugify_1.default)(context.dir) + "-node-modules",
24185
24185
  // 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
24186
24186
  policy: policy,
24187
24187
  paths: __spreadArray([], __read(componentIsInWorkspace ? (0, lodash_1.uniq)(__spreadArray(["node_modules"], __read((_c = (_b = context.packageManagerInfo) === null || _b === void 0 ? void 0 : _b.workspaces.map(function (w) {
24188
24188
  return (0, path_1.join)(w.location, "node_modules");
24189
- })) !== null && _c !== void 0 ? _c : []), false)) : [(0, path_1.join)(context.componentConfig.dir, "node_modules")]), false)
24189
+ })) !== null && _c !== void 0 ? _c : []), false)) : [(0, path_1.join)(context.dir, "node_modules")]), false)
24190
24190
  }];
24191
24191
  };
24192
24192
  exports.getNodeModulesCache = getNodeModulesCache;
@@ -24345,10 +24345,10 @@ var createMeteorBuildJobs = function (context) {
24345
24345
  if (!(0, types_1.isOfBuildType)(buildConfig, "meteor")) {
24346
24346
  throw new Error("deploy config is not meteor");
24347
24347
  }
24348
- var yarnInstall = (0, yarn_1.getYarnInstall)(context);
24348
+ var yarnInstall = (0, yarn_1.getYarnInstall)(context.buildContext);
24349
24349
  return (0, base_1.createBuildJobs)(context, {
24350
24350
  appBuild: buildConfig.buildCommand !== null ? {
24351
- cache: __spreadArray(__spreadArray([], __read((0, cache_1.getNodeCache)(context)), false), __read(getMeteorCache(context)), false),
24351
+ cache: __spreadArray(__spreadArray([], __read((0, cache_1.getNodeCache)(context.buildContext)), false), __read(getMeteorCache(context)), false),
24352
24352
  image: (0, runner_1.getRunnerImage)("jobs-meteor"),
24353
24353
  variables: {
24354
24354
  METEOR_DISABLE_OPTIMISTIC_CACHING: "1" // see https://forums.meteor.com/t/veeery-long-building-time-inside-docker-container/58673/17?u=macrozone
@@ -24446,13 +24446,13 @@ var createNodeTestJobs = function (context) {
24446
24446
  needs: [],
24447
24447
  envMode: "none"
24448
24448
  };
24449
- var yarnInstall = (0, yarn_1.getYarnInstall)(context);
24449
+ var yarnInstall = (0, yarn_1.getYarnInstall)(context.buildContext);
24450
24450
  var auditJob = buildConfig.audit !== false ? __assign(__assign(__assign({
24451
24451
  name: "🛡 audit"
24452
24452
  }, base), {
24453
24453
  image: (_c = (_b = buildConfig.audit) === null || _b === void 0 ? void 0 : _b.jobImage) !== null && _c !== void 0 ? _c : defaultImage,
24454
24454
  cache: undefined,
24455
- script: __spreadArray(["cd ".concat(context.componentConfig.dir)], __read((_e = (0, utils_1.ensureArray)((_d = buildConfig.audit) === null || _d === void 0 ? void 0 : _d.command)) !== null && _e !== void 0 ? _e : [((_f = context.packageManagerInfo) === null || _f === void 0 ? void 0 : _f.isClassic) ? "yarn audit" : "yarn npm audit --environment production" // yarn 2
24455
+ script: __spreadArray(["cd ".concat(context.componentConfig.dir)], __read((_e = (0, utils_1.ensureArray)((_d = buildConfig.audit) === null || _d === void 0 ? void 0 : _d.command)) !== null && _e !== void 0 ? _e : [((_f = context.buildContext.packageManagerInfo) === null || _f === void 0 ? void 0 : _f.isClassic) ? "yarn audit" : "yarn npm audit --environment production" // yarn 2
24456
24456
  ]), false),
24457
24457
  allow_failure: true
24458
24458
  }), (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;
@@ -24460,15 +24460,15 @@ var createNodeTestJobs = function (context) {
24460
24460
  name: "👮 lint"
24461
24461
  }, base), {
24462
24462
  image: (_k = (_j = buildConfig.lint) === null || _j === void 0 ? void 0 : _j.jobImage) !== null && _k !== void 0 ? _k : defaultImage,
24463
- cache: (0, cache_1.getNodeCache)(context),
24464
- script: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, yarn_1.ensureNodeVersion)(context)), false), ["cd ".concat(context.componentConfig.dir)], 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)
24463
+ cache: (0, cache_1.getNodeCache)(context.buildContext),
24464
+ script: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, yarn_1.ensureNodeVersion)(context.buildContext)), false), ["cd ".concat(context.componentConfig.dir)], 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)
24465
24465
  }), (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;
24466
24466
  var testJob = buildConfig.test !== false ? __assign(__assign(__assign({
24467
24467
  name: "🧪 test"
24468
24468
  }, base), {
24469
24469
  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"),
24470
- cache: (0, cache_1.getNodeCache)(context),
24471
- script: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, yarn_1.ensureNodeVersion)(context)), false), ["cd ".concat(context.componentConfig.dir)], 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)
24470
+ cache: (0, cache_1.getNodeCache)(context.buildContext),
24471
+ script: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read((0, yarn_1.ensureNodeVersion)(context.buildContext)), false), ["cd ".concat(context.componentConfig.dir)], 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)
24472
24472
  }), (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;
24473
24473
  return [auditJob, lintJob, testJob].filter(utils_1.notNil);
24474
24474
  };
@@ -24536,7 +24536,7 @@ var ensureNodeVersion = function (context) {
24536
24536
  exports.ensureNodeVersion = ensureNodeVersion;
24537
24537
  var getYarnInstall = function (context, options) {
24538
24538
  var _a;
24539
- var postInstall = "postInstall" in context.componentConfig.build ? context.componentConfig.build.postInstall : null;
24539
+ var postInstall = "postInstall" in context.config ? context.config.postInstall : null;
24540
24540
  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) ? (0, gitlab_1.collapseableSection)("postinstall", "Custom post install")((_a = (0, utils_1.ensureArray)(postInstall)) !== null && _a !== void 0 ? _a : []) : []), false);
24541
24541
  };
24542
24542
  exports.getYarnInstall = getYarnInstall;
@@ -24825,7 +24825,7 @@ var createSbomBuildJob = function (context) {
24825
24825
  var _a, _b, _c, _d, _e;
24826
24826
  var buildConfig = context.componentConfig.build;
24827
24827
  var defaultImage = "aquasec/trivy:0.38.3";
24828
- var defaultScript = ["trivy fs --quiet --format cyclonedx --output \"".concat(exports.SBOM_FILE, "\" ").concat(((_a = context.packageManagerInfo) === null || _a === void 0 ? void 0 : _a.componentIsInWorkspace) ? "." : context.componentConfig.dir)];
24828
+ var defaultScript = ["trivy fs --quiet --format cyclonedx --output \"".concat(exports.SBOM_FILE, "\" ").concat(((_a = context.buildContext.packageManagerInfo) === null || _a === void 0 ? void 0 : _a.componentIsInWorkspace) ? "." : context.buildContext.dir)];
24829
24829
  var image = buildConfig.type === "custom" && buildConfig.sbom !== false ? (_c = (_b = buildConfig.sbom) === null || _b === void 0 ? void 0 : _b.jobImage) !== null && _c !== void 0 ? _c : defaultImage : defaultImage;
24830
24830
  var script = buildConfig.type === "custom" && buildConfig.sbom !== false ? (_e = (0, utils_1.ensureArray)((_d = buildConfig.sbom) === null || _d === void 0 ? void 0 : _d.command)) !== null && _e !== void 0 ? _e : defaultScript : defaultScript;
24831
24831
  return {
@@ -25049,7 +25049,7 @@ Object.defineProperty(exports, "__esModule", ({
25049
25049
  value: true
25050
25050
  }));
25051
25051
  exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
25052
- exports.PIPELINE_IMAGE_TAG = "refactor-docker-9fda97e9" || 0;
25052
+ exports.PIPELINE_IMAGE_TAG = "refactor-docker-c24f8608" || 0;
25053
25053
  exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || 0;
25054
25054
 
25055
25055
  /***/ }),
@@ -25540,8 +25540,7 @@ var getEnvironmentVariables = function (ctx_1) {
25540
25540
  for (var _i = 1; _i < arguments.length; _i++) {
25541
25541
  args_1[_i - 1] = arguments[_i];
25542
25542
  }
25543
- return __awaiter(void 0, __spreadArray([ctx_1], __read(args_1), false), void 0, function (ctx, alreadyVisited // to prevent endless loop
25544
- ) {
25543
+ return __awaiter(void 0, __spreadArray([ctx_1], __read(args_1), false), void 0, function (ctx, alreadyVisited) {
25545
25544
  var environmentContext, config, env, componentName, envConfigRaw, deployConfigRaw, buildConfigRaw, envType, basePredefinedVariables, predefinedVariables, host, url, devLocalConfig, port, additionalEnvVars, HOST_INTERNAL, publicEnvVarsRaw, additionalSecretKeys, secretEnvVarKeys, secretEnvVars, legacyFromComponents, publicEnvVarsRawWithLegacyFromComponents, publicEnvVarsRawSanitized, envVarsRaw, envVars;
25546
25545
  var _a, _b;
25547
25546
  var _c, _d, _e, _f, _g, _h, _j, _k, _l;
@@ -25866,7 +25865,7 @@ var __generator = this && this.__generator || function (thisArg, body) {
25866
25865
  Object.defineProperty(exports, "__esModule", ({
25867
25866
  value: true
25868
25867
  }));
25869
- exports.createContext = void 0;
25868
+ exports.createContext = exports.createComponentContext = void 0;
25870
25869
  var build_1 = __nccwpck_require__(2004);
25871
25870
  var deploy_1 = __nccwpck_require__(1264);
25872
25871
  var utils_1 = __nccwpck_require__(1815);
@@ -25874,7 +25873,7 @@ var getEnvironment_1 = __nccwpck_require__(4029);
25874
25873
  var getEnvironmentContext_1 = __nccwpck_require__(3817);
25875
25874
  __exportStar(__nccwpck_require__(4029), exports);
25876
25875
  __exportStar(__nccwpck_require__(2292), exports);
25877
- var createContext = function (ctx) {
25876
+ var createComponentContext = function (ctx) {
25878
25877
  return __awaiter(void 0, void 0, void 0, function () {
25879
25878
  var envContext, componentConfigWithoutDefaults, defaults, componentConfig;
25880
25879
  var _a;
@@ -25897,6 +25896,11 @@ var createContext = function (ctx) {
25897
25896
  _a = {
25898
25897
  fullConfig: ctx.config,
25899
25898
  componentConfig: componentConfig,
25899
+ buildContext: {
25900
+ dir: componentConfig.dir,
25901
+ packageManagerInfo: ctx.packageManagerInfo,
25902
+ config: componentConfig.build
25903
+ },
25900
25904
  componentName: ctx.componentName
25901
25905
  };
25902
25906
  return [4 /*yield*/, (0, getEnvironment_1.getEnvironment)(ctx)];
@@ -25906,7 +25910,11 @@ var createContext = function (ctx) {
25906
25910
  });
25907
25911
  });
25908
25912
  };
25909
- exports.createContext = createContext;
25913
+ exports.createComponentContext = createComponentContext;
25914
+ /**
25915
+ * @deprecated use createComponentContext instead
25916
+ */
25917
+ exports.createContext = exports.createComponentContext;
25910
25918
 
25911
25919
  /***/ }),
25912
25920
 
@@ -27467,8 +27475,7 @@ function getCloudRunDeployScripts(context) {
27467
27475
  name = _b[0],
27468
27476
  service = _b[1];
27469
27477
  return (0, cloudRunServices_1.getServiceDeployScript)(context, service, "-" + name);
27470
- })), false), __read((0, cloudRunJobs_1.getJobRunScripts)(context, "postDeploy")), false))), false), __read((0, gitlab_1.collapseableSection)("cleanup", "Cleanup")((0, cleanup_1.getRemoveOldRevisionsAndImagesCommand)(context, "postDeploy") // we cleanup inactive images both on deploy and stop
27471
- )), false), __read((0, sbom_1.getDependencyTrackUploadScript)(context)), false);
27478
+ })), false), __read((0, cloudRunJobs_1.getJobRunScripts)(context, "postDeploy")), false))), false), __read((0, gitlab_1.collapseableSection)("cleanup", "Cleanup")((0, cleanup_1.getRemoveOldRevisionsAndImagesCommand)(context, "postDeploy"))), false), __read((0, sbom_1.getDependencyTrackUploadScript)(context)), false);
27472
27479
  }
27473
27480
  exports.getCloudRunDeployScripts = getCloudRunDeployScripts;
27474
27481
 
@@ -28112,7 +28119,7 @@ var createCustomDeployJobs = function (context) {
28112
28119
  throw new Error("deploy config is not custom");
28113
28120
  }
28114
28121
  // FIXME: custom deploy currently assumes yarn-based project
28115
- var yarnInstall = (0, yarn_1.getYarnInstall)(context, {
28122
+ var yarnInstall = (0, yarn_1.getYarnInstall)(context.buildContext, {
28116
28123
  noCustomPostInstall: true
28117
28124
  });
28118
28125
  return (0, base_1.createDeployementJobs)(context, {
@@ -28784,10 +28791,8 @@ var createAppConfig = function (context, application) {
28784
28791
  }
28785
28792
  },
28786
28793
  // default
28787
- rest // merge rest in
28788
- );
28794
+ rest);
28789
28795
  };
28790
-
28791
28796
  var removeFalsy = function (record) {
28792
28797
  if (!record) return undefined;
28793
28798
  return Object.fromEntries(Object.entries(record).filter(function (_a) {
@@ -29767,7 +29772,7 @@ var createJobsForComponent = function (contextContext) {
29767
29772
  return [4 /*yield*/, (0, packageManager_1.getPackageManagerInfo)(contextContext.config, contextContext.componentName)];
29768
29773
  case 1:
29769
29774
  packageManagerInfo = _a.sent();
29770
- return [4 /*yield*/, (0, context_1.createContext)(__assign(__assign({}, contextContext), {
29775
+ return [4 /*yield*/, (0, context_1.createComponentContext)(__assign(__assign({}, contextContext), {
29771
29776
  packageManagerInfo: packageManagerInfo
29772
29777
  }))];
29773
29778
  case 2:
@@ -30189,7 +30194,7 @@ var createMainPipeline_1 = __nccwpck_require__(7373);
30189
30194
  var getPipelineTriggerForGitlabChildPipeline_1 = __nccwpck_require__(8587);
30190
30195
  function generatePipelineFiles(config, pipelineType, mode) {
30191
30196
  return __awaiter(this, void 0, void 0, function () {
30192
- var trigger, _a, jobs, mainPipeline, _b, jobs, mainPipeline;
30197
+ var trigger, _a, jobs, image, stages, variables, workflow, mainPipeline, _b, jobs, image, stages, variables, workflow, mainPipeline;
30193
30198
  return __generator(this, function (_c) {
30194
30199
  switch (_c.label) {
30195
30200
  case 0:
@@ -30197,9 +30202,14 @@ function generatePipelineFiles(config, pipelineType, mode) {
30197
30202
  trigger = (0, getPipelineTriggerForGitlabChildPipeline_1.getPipelineTriggerForGitlabChildPipeline)();
30198
30203
  return [4 /*yield*/, (0, createChildPipeline_1.createChildPipeline)(pipelineType, trigger, config)];
30199
30204
  case 1:
30200
- _a = _c.sent(), jobs = _a.jobs, mainPipeline = __rest(_a, ["jobs"]);
30205
+ _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"]);
30201
30206
  // need to spread out the jobs, forgot why
30202
- return [4 /*yield*/, (0, writeFiles_1.writeYamlfile)("__pipeline.yml", __assign(__assign({}, jobs), mainPipeline))];
30207
+ return [4 /*yield*/, (0, writeFiles_1.writeYamlfile)("__pipeline.yml", __assign(__assign({
30208
+ image: image,
30209
+ stages: stages,
30210
+ variables: variables,
30211
+ workflow: workflow
30212
+ }, mainPipeline), jobs))];
30203
30213
  case 2:
30204
30214
  // need to spread out the jobs, forgot why
30205
30215
  _c.sent();
@@ -30207,9 +30217,14 @@ function generatePipelineFiles(config, pipelineType, mode) {
30207
30217
  case 3:
30208
30218
  return [4 /*yield*/, (0, createMainPipeline_1.createMainPipeline)(pipelineType, config)];
30209
30219
  case 4:
30210
- _b = _c.sent(), jobs = _b.jobs, mainPipeline = __rest(_b, ["jobs"]);
30220
+ _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"]);
30211
30221
  // need to spread out the jobs, forgot why
30212
- return [4 /*yield*/, (0, writeFiles_1.writeYamlfile)(".gitlab-ci.yml", __assign(__assign({}, jobs), mainPipeline))];
30222
+ return [4 /*yield*/, (0, writeFiles_1.writeYamlfile)(".gitlab-ci.yml", __assign(__assign({
30223
+ image: image,
30224
+ stages: stages,
30225
+ variables: variables,
30226
+ workflow: workflow
30227
+ }, mainPipeline), jobs))];
30213
30228
  case 5:
30214
30229
  // need to spread out the jobs, forgot why
30215
30230
  _c.sent();
package/dist/constants.js CHANGED
@@ -4,5 +4,5 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
7
- exports.PIPELINE_IMAGE_TAG = "refactor-docker-9fda97e9" || "latest";
7
+ exports.PIPELINE_IMAGE_TAG = "refactor-docker-c24f8608" || "latest";
8
8
  exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || "git.panter.ch:5001/catladder/catladder";
@@ -1,3 +1,3 @@
1
- import type { CreateContextContext } from "..";
1
+ import type { CreateComponentContextContext } from "..";
2
2
  import type { Environment } from "../types/context";
3
- export declare const getEnvironment: (ctx: CreateContextContext) => Promise<Environment>;
3
+ export declare const getEnvironment: (ctx: CreateComponentContextContext) => Promise<Environment>;
@@ -1,8 +1,8 @@
1
- import type { CreateContextContext } from "..";
1
+ import type { CreateComponentContextContext } from "..";
2
2
  import type { EnvironmentContext } from "../types/environmentContext";
3
3
  export declare const getEnvironmentContext: ({
4
4
  env,
5
5
  componentName,
6
6
  config,
7
7
  pipelineType
8
- }: CreateContextContext) => EnvironmentContext<any, any>;
8
+ }: CreateComponentContextContext) => EnvironmentContext<any, any>;
@@ -1,5 +1,5 @@
1
- import type { Context, EnvironmentEnvVarPart as EnvironmentVariables } from "../types";
2
- import type { CreateContextContext } from "..";
1
+ import type { ComponentContext, EnvironmentEnvVarPart as EnvironmentVariables } from "../types";
2
+ import type { CreateComponentContextContext } from "..";
3
3
  import type { StringOrBashExpression } from "../bash/BashExpression";
4
4
  import type { EnvironmentContext } from "../types/environmentContext";
5
5
  export type SecretEnvVar = {
@@ -24,7 +24,7 @@ export type PredefinedVariables = BasePredefinedVariables & {
24
24
  HOST_INTERNAL: StringOrBashExpression;
25
25
  ROOT_URL_INTERNAL: StringOrBashExpression;
26
26
  };
27
- export declare const getEnvironmentVariables: (ctx: CreateContextContext, alreadyVisited?: Record<string, Record<string, boolean>>) => Promise<EnvironmentVariables>;
27
+ export declare const getEnvironmentVariables: (ctx: CreateComponentContextContext, alreadyVisited?: Record<string, Record<string, boolean>>) => Promise<EnvironmentVariables>;
28
28
  export declare const getSecretVarName: (env: string, componentName: string, key: string) => string;
29
- export declare const getSecretVarNameForContext: (context: Context, key: string) => string;
29
+ export declare const getSecretVarNameForContext: (context: ComponentContext, key: string) => string;
30
30
  export {};
@@ -180,8 +180,7 @@ var getEnvironmentVariables = function (ctx_1) {
180
180
  for (var _i = 1; _i < arguments.length; _i++) {
181
181
  args_1[_i - 1] = arguments[_i];
182
182
  }
183
- return __awaiter(void 0, __spreadArray([ctx_1], __read(args_1), false), void 0, function (ctx, alreadyVisited // to prevent endless loop
184
- ) {
183
+ return __awaiter(void 0, __spreadArray([ctx_1], __read(args_1), false), void 0, function (ctx, alreadyVisited) {
185
184
  var environmentContext, config, env, componentName, envConfigRaw, deployConfigRaw, buildConfigRaw, envType, basePredefinedVariables, predefinedVariables, host, url, devLocalConfig, port, additionalEnvVars, HOST_INTERNAL, publicEnvVarsRaw, additionalSecretKeys, secretEnvVarKeys, secretEnvVars, legacyFromComponents, publicEnvVarsRawWithLegacyFromComponents, publicEnvVarsRawSanitized, envVarsRaw, envVars;
186
185
  var _a, _b;
187
186
  var _c, _d, _e, _f, _g, _h, _j, _k, _l;
@@ -1,5 +1,5 @@
1
- import type { Context } from "../types";
2
- export declare const getLabels: (context: Context) => {
1
+ import type { ComponentContext } from "../types";
2
+ export declare const getLabels: (context: ComponentContext) => {
3
3
  "customer-name": string | undefined;
4
4
  "component-name": string | undefined;
5
5
  "app-name": string | undefined;
@@ -1,9 +1,9 @@
1
1
  import type { PipelineType } from "../types";
2
2
  import type { Config, PipelineTrigger } from "../types/config";
3
- import type { Context, PackageManagerInfo } from "../types/context";
3
+ import type { ComponentContext, PackageManagerInfo } from "../types/context";
4
4
  export * from "./getEnvironment";
5
5
  export * from "./getEnvironmentVariables";
6
- export type CreateContextContext = {
6
+ export type CreateComponentContextContext = {
7
7
  config: Config;
8
8
  componentName: string;
9
9
  env: string;
@@ -11,4 +11,8 @@ export type CreateContextContext = {
11
11
  trigger?: PipelineTrigger;
12
12
  packageManagerInfo?: PackageManagerInfo;
13
13
  };
14
- export declare const createContext: (ctx: CreateContextContext) => Promise<Context>;
14
+ export declare const createComponentContext: (ctx: CreateComponentContextContext) => Promise<ComponentContext>;
15
+ /**
16
+ * @deprecated use createComponentContext instead
17
+ */
18
+ export declare const createContext: (ctx: CreateComponentContextContext) => Promise<ComponentContext>;
@@ -137,7 +137,7 @@ var __generator = this && this.__generator || function (thisArg, body) {
137
137
  Object.defineProperty(exports, "__esModule", {
138
138
  value: true
139
139
  });
140
- exports.createContext = void 0;
140
+ exports.createContext = exports.createComponentContext = void 0;
141
141
  var build_1 = require("../build");
142
142
  var deploy_1 = require("../deploy");
143
143
  var utils_1 = require("../utils");
@@ -145,7 +145,7 @@ var getEnvironment_1 = require("./getEnvironment");
145
145
  var getEnvironmentContext_1 = require("./getEnvironmentContext");
146
146
  __exportStar(require("./getEnvironment"), exports);
147
147
  __exportStar(require("./getEnvironmentVariables"), exports);
148
- var createContext = function (ctx) {
148
+ var createComponentContext = function (ctx) {
149
149
  return __awaiter(void 0, void 0, void 0, function () {
150
150
  var envContext, componentConfigWithoutDefaults, defaults, componentConfig;
151
151
  var _a;
@@ -168,6 +168,11 @@ var createContext = function (ctx) {
168
168
  _a = {
169
169
  fullConfig: ctx.config,
170
170
  componentConfig: componentConfig,
171
+ buildContext: {
172
+ dir: componentConfig.dir,
173
+ packageManagerInfo: ctx.packageManagerInfo,
174
+ config: componentConfig.build
175
+ },
171
176
  componentName: ctx.componentName
172
177
  };
173
178
  return [4 /*yield*/, (0, getEnvironment_1.getEnvironment)(ctx)];
@@ -177,4 +182,8 @@ var createContext = function (ctx) {
177
182
  });
178
183
  });
179
184
  };
180
- exports.createContext = createContext;
185
+ exports.createComponentContext = createComponentContext;
186
+ /**
187
+ * @deprecated use createComponentContext instead
188
+ */
189
+ exports.createContext = exports.createComponentContext;
@@ -1,5 +1,5 @@
1
- import type { Context } from "../../types/context";
1
+ import type { ComponentContext } from "../../types/context";
2
2
  import type { CatladderJob } from "../../types/jobs";
3
3
  export declare const DEPLOY_JOB_NAME = "\uD83D\uDE80 Deploy";
4
4
  export type DeployJobDefinition = Pick<CatladderJob, "script" | "variables" | "image" | "cache" | "artifacts" | "services" | "runnerVariables">;
5
- export declare const createDeployJob: (context: Context, jobDefinition: DeployJobDefinition) => CatladderJob;
5
+ export declare const createDeployJob: (context: ComponentContext, jobDefinition: DeployJobDefinition) => CatladderJob;
@@ -1,9 +1,9 @@
1
- import type { Context } from "../../types/context";
1
+ import type { ComponentContext } from "../../types/context";
2
2
  import type { CatladderJob } from "../../types/jobs";
3
3
  import { type DeployJobDefinition } from "./deploy";
4
4
  import { type RollbackJobDefinition } from "./rollback";
5
5
  import { type StopJobDefinition } from "./stop";
6
- export declare const createDeployementJobs: (context: Context, definitions: {
6
+ export declare const createDeployementJobs: (context: ComponentContext, definitions: {
7
7
  deploy: DeployJobDefinition;
8
8
  stop?: StopJobDefinition;
9
9
  rollback?: RollbackJobDefinition;
@@ -1,5 +1,5 @@
1
- import type { Context } from "../../types/context";
1
+ import type { ComponentContext } from "../../types/context";
2
2
  import type { CatladderJob } from "../../types/jobs";
3
3
  export declare const ROLLBACK_JOB_NAME = "\u21A9\uFE0F Rollback \u26A0\uFE0F";
4
4
  export type RollbackJobDefinition = Pick<CatladderJob, "script" | "variables" | "runnerVariables" | "image">;
5
- export declare const createRollbackJob: (context: Context, jobDefinition: RollbackJobDefinition) => CatladderJob;
5
+ export declare const createRollbackJob: (context: ComponentContext, jobDefinition: RollbackJobDefinition) => CatladderJob;
@@ -1,5 +1,5 @@
1
- import type { Context } from "../../types/context";
1
+ import type { ComponentContext } from "../../types/context";
2
2
  import type { CatladderJob } from "../../types/jobs";
3
3
  export declare const STOP_JOB_NAME = "\uD83D\uDED1 Stop \u26A0\uFE0F";
4
4
  export type StopJobDefinition = Pick<CatladderJob, "script" | "variables" | "image" | "runnerVariables">;
5
- export declare const createStopJob: (context: Context, jobDefinition: StopJobDefinition) => CatladderJob;
5
+ export declare const createStopJob: (context: ComponentContext, jobDefinition: StopJobDefinition) => CatladderJob;
@@ -1,18 +1,18 @@
1
1
  import type { StringOrBashExpression } from "../../bash/BashExpression";
2
- import type { Context } from "../../types/context";
2
+ import type { ComponentContext } from "../../types/context";
3
3
  export declare const getArtifactsRegistryHost: ({
4
4
  componentConfig: {
5
5
  deploy
6
6
  }
7
- }: Context) => string;
8
- export declare const getArtifactsRegistryDockerUrl: (context: Context) => string;
7
+ }: ComponentContext) => string;
8
+ export declare const getArtifactsRegistryDockerUrl: (context: ComponentContext) => string;
9
9
  /**
10
10
  *
11
11
  * lecacyReviewImageName is only temporary. In old versions the images had no reviewslug in review apps, which makes cleanup harder. We delete all those images now, but need the path
12
12
  */
13
- export declare const getArtifactsRegistryImageName: (context: Context, lecacyReviewImageName?: boolean) => StringOrBashExpression;
14
- export declare const getArtifactsRegistryBuildCacheImage: (context: Context) => string;
15
- export declare const getArtifactsRegistryImage: (context: Context) => string;
13
+ export declare const getArtifactsRegistryImageName: (context: ComponentContext, lecacyReviewImageName?: boolean) => StringOrBashExpression;
14
+ export declare const getArtifactsRegistryBuildCacheImage: (context: ComponentContext) => string;
15
+ export declare const getArtifactsRegistryImage: (context: ComponentContext) => string;
16
16
  /**
17
17
  * commands to delete unused images.
18
18
  *
@@ -20,4 +20,4 @@ export declare const getArtifactsRegistryImage: (context: Context) => string;
20
20
  * @param keep how many of the newest images to keep
21
21
  * @returns
22
22
  */
23
- export declare const getDeleteUnusedImagesCommands: (context: Context, keep?: number) => string[];
23
+ export declare const getDeleteUnusedImagesCommands: (context: ComponentContext, keep?: number) => string[];
@@ -1,2 +1,2 @@
1
- import type { Context } from "../../types/context";
2
- export declare const getRemoveOldRevisionsAndImagesCommand: (context: Context, when: "postDeploy" | "onStop") => string[];
1
+ import type { ComponentContext } from "../../types/context";
2
+ export declare const getRemoveOldRevisionsAndImagesCommand: (context: ComponentContext, when: "postDeploy" | "onStop") => string[];
@@ -1,2 +1,2 @@
1
- import type { Context } from "../../types/context";
2
- export declare const getDeleteUnusedRevisionsCommands: (context: Context, keep: number) => string[];
1
+ import type { ComponentContext } from "../../types/context";
2
+ export declare const getDeleteUnusedRevisionsCommands: (context: ComponentContext, keep: number) => string[];
@@ -1,7 +1,7 @@
1
- import type { Context } from "../../../types/context";
1
+ import type { ComponentContext } from "../../../types/context";
2
2
  import type { DeployConfigCloudRunJob } from "../../types/googleCloudRun";
3
- export declare const getDeleteSchedulesScripts: (context: Context) => string[];
4
- export declare const getDeleteJobsScripts: (context: Context) => string[];
5
- export declare const getJobRunScripts: (context: Context, when: DeployConfigCloudRunJob["when"]) => string[];
6
- export declare const getJobCreateScripts: (context: Context) => string[];
7
- export declare const getCreateScheduleScripts: (context: Context) => string[];
3
+ export declare const getDeleteSchedulesScripts: (context: ComponentContext) => string[];
4
+ export declare const getDeleteJobsScripts: (context: ComponentContext) => string[];
5
+ export declare const getJobRunScripts: (context: ComponentContext, when: DeployConfigCloudRunJob["when"]) => string[];
6
+ export declare const getJobCreateScripts: (context: ComponentContext) => string[];
7
+ export declare const getCreateScheduleScripts: (context: ComponentContext) => string[];
@@ -1,4 +1,4 @@
1
- import type { Context } from "../../../types/context";
1
+ import type { ComponentContext } from "../../../types/context";
2
2
  import type { DeployConfigCloudRunService } from "../../types/googleCloudRun";
3
- export declare const getServiceDeployScript: (context: Context, service: DeployConfigCloudRunService | true | undefined, nameSuffix?: string) => string;
4
- export declare const getServiceDeleteScript: (context: Context, serviceSuffix?: string) => string[];
3
+ export declare const getServiceDeployScript: (context: ComponentContext, service: DeployConfigCloudRunService | true | undefined, nameSuffix?: string) => string;
4
+ export declare const getServiceDeleteScript: (context: ComponentContext, serviceSuffix?: string) => string[];
@@ -1,16 +1,16 @@
1
- import type { Context } from "../../../types/context";
1
+ import type { ComponentContext } from "../../../types/context";
2
2
  import type { DeployConfigCloudRun } from "../../types/googleCloudRun";
3
3
  export declare const gcloudCmd: (version?: "beta") => string;
4
4
  export declare const gcloudRunCmd: (version?: "beta") => string;
5
5
  export declare const gcloudSchedulerCmd: (version?: "beta") => string;
6
6
  export declare const setGoogleProjectNumberScript: (deployConfig: DeployConfigCloudRun) => string[];
7
7
  export declare const makeLabelString: (obj: Record<string, unknown>) => string;
8
- export declare const getCloudRunDeployConfig: (context: Context) => DeployConfigCloudRun;
9
- export declare function getCommonCloudRunArgs(context: Context): {
8
+ export declare const getCloudRunDeployConfig: (context: ComponentContext) => DeployConfigCloudRun;
9
+ export declare function getCommonCloudRunArgs(context: ComponentContext): {
10
10
  project: string;
11
11
  region: import("../../types").Gcloudregion;
12
12
  };
13
- export declare function getCommonDeployArgs(context: Context): {
13
+ export declare function getCommonDeployArgs(context: ComponentContext): {
14
14
  "set-cloudsql-instances": string | undefined;
15
15
  project: string;
16
16
  region: import("../../types").Gcloudregion;
@@ -1,2 +1,2 @@
1
- import type { Context } from "../../../types/context";
2
- export declare function getCloudRunDeployScripts(context: Context): string[];
1
+ import type { ComponentContext } from "../../../types/context";
2
+ export declare function getCloudRunDeployScripts(context: ComponentContext): string[];
@@ -57,7 +57,6 @@ function getCloudRunDeployScripts(context) {
57
57
  name = _b[0],
58
58
  service = _b[1];
59
59
  return (0, cloudRunServices_1.getServiceDeployScript)(context, service, "-" + name);
60
- })), false), __read((0, cloudRunJobs_1.getJobRunScripts)(context, "postDeploy")), false))), false), __read((0, gitlab_1.collapseableSection)("cleanup", "Cleanup")((0, cleanup_1.getRemoveOldRevisionsAndImagesCommand)(context, "postDeploy") // we cleanup inactive images both on deploy and stop
61
- )), false), __read((0, sbom_1.getDependencyTrackUploadScript)(context)), false);
60
+ })), false), __read((0, cloudRunJobs_1.getJobRunScripts)(context, "postDeploy")), false))), false), __read((0, gitlab_1.collapseableSection)("cleanup", "Cleanup")((0, cleanup_1.getRemoveOldRevisionsAndImagesCommand)(context, "postDeploy"))), false), __read((0, sbom_1.getDependencyTrackUploadScript)(context)), false);
62
61
  }
63
62
  exports.getCloudRunDeployScripts = getCloudRunDeployScripts;
@@ -1,2 +1,2 @@
1
- import type { Context } from "../../../types/context";
2
- export declare function getCloudRunStopScripts(context: Context): string[];
1
+ import type { ComponentContext } from "../../../types/context";
2
+ export declare function getCloudRunStopScripts(context: ComponentContext): string[];
@@ -1,3 +1,3 @@
1
- import type { Context } from "../../../types/context";
1
+ import type { ComponentContext } from "../../../types/context";
2
2
  import type { CatladderJob } from "../../../types/jobs";
3
- export declare const createGoogleCloudRunDeployJobs: (context: Context) => CatladderJob[];
3
+ export declare const createGoogleCloudRunDeployJobs: (context: ComponentContext) => CatladderJob[];