@catladder/pipeline 1.156.3 → 1.157.0

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 (47) hide show
  1. package/dist/build/docker.d.ts +4 -4
  2. package/dist/build/docker.js +3 -2
  3. package/dist/build/types.d.ts +4 -0
  4. package/dist/bundles/catladder-gitlab/index.js +1 -1
  5. package/dist/constants.js +1 -1
  6. package/dist/pipeline/createChildPipeline.js +2 -1
  7. package/dist/pipeline/createMainPipeline.js +2 -1
  8. package/dist/tsconfig.tsbuildinfo +1 -1
  9. package/dist/types/config.d.ts +4 -0
  10. package/examples/__snapshots__/cloud-run-memory-limit.ts.snap +8 -8
  11. package/examples/__snapshots__/cloud-run-meteor-with-worker.ts.snap +8 -8
  12. package/examples/__snapshots__/cloud-run-no-cpu-throttling.ts.snap +8 -8
  13. package/examples/__snapshots__/cloud-run-no-service.ts.snap +8 -8
  14. package/examples/__snapshots__/cloud-run-non-public.ts.snap +8 -8
  15. package/examples/__snapshots__/cloud-run-post-stop-job.ts.snap +8 -8
  16. package/examples/__snapshots__/cloud-run-service-gen2.ts.snap +8 -8
  17. package/examples/__snapshots__/cloud-run-service-increase-timout.ts.snap +8 -8
  18. package/examples/__snapshots__/cloud-run-service-with-volumes.ts.snap +8 -8
  19. package/examples/__snapshots__/cloud-run-storybook.ts.snap +8 -8
  20. package/examples/__snapshots__/cloud-run-with-ngnix.ts.snap +8 -8
  21. package/examples/__snapshots__/cloud-run-with-sql-reuse-db.ts.snap +16 -16
  22. package/examples/__snapshots__/cloud-run-with-sql.ts.snap +16 -16
  23. package/examples/__snapshots__/cloud-run-with-worker.ts.snap +8 -8
  24. package/examples/__snapshots__/custom-build-job-with-tests.ts.snap +8 -8
  25. package/examples/__snapshots__/custom-build-job.ts.snap +8 -8
  26. package/examples/__snapshots__/custom-deploy.ts.snap +8 -8
  27. package/examples/__snapshots__/custom-sbom-java.ts.snap +8 -8
  28. package/examples/__snapshots__/git-submodule.ts.snap +1962 -0
  29. package/examples/__snapshots__/kubernetes-application-customization.ts.snap +8 -8
  30. package/examples/__snapshots__/kubernetes-with-cloud-sql-legacy.ts.snap +8 -8
  31. package/examples/__snapshots__/kubernetes-with-cloud-sql.ts.snap +8 -8
  32. package/examples/__snapshots__/kubernetes-with-jobs.ts.snap +16 -16
  33. package/examples/__snapshots__/kubernetes-with-mongodb.ts.snap +8 -8
  34. package/examples/__snapshots__/local-dot-env.ts.snap +8 -8
  35. package/examples/__snapshots__/meteor-kubernetes.ts.snap +8 -8
  36. package/examples/__snapshots__/multiline-var.ts.snap +16 -16
  37. package/examples/__snapshots__/native-app.ts.snap +8 -8
  38. package/examples/__snapshots__/node-build-with-custom-image.ts.snap +8 -8
  39. package/examples/__snapshots__/node-build-with-docker-additions.ts.snap +8 -8
  40. package/examples/__snapshots__/rails-k8s-with-worker.ts.snap +12 -12
  41. package/examples/git-submodule.ts +29 -0
  42. package/package.json +1 -1
  43. package/src/build/docker.ts +8 -2
  44. package/src/build/types.ts +5 -0
  45. package/src/pipeline/createChildPipeline.ts +1 -0
  46. package/src/pipeline/createMainPipeline.ts +1 -0
  47. package/src/types/config.ts +5 -0
@@ -23,7 +23,7 @@ export declare const getDockerBuildVariables: (context: ComponentContext) => {
23
23
  DOCKER_IMAGE: import("../bash/BashExpression").StringOrBashExpression;
24
24
  DOCKER_CACHE_IMAGE: string;
25
25
  APP_DIR: string;
26
- DOCKER_DIR: string;
26
+ DOCKER_BUILD_CONTEXT: string;
27
27
  DOCKERFILE_ADDITIONS?: undefined;
28
28
  DOCKERFILE_ADDITIONS_END?: undefined;
29
29
  } | {
@@ -33,7 +33,7 @@ export declare const getDockerBuildVariables: (context: ComponentContext) => {
33
33
  DOCKER_IMAGE_NAME: string;
34
34
  DOCKER_IMAGE: string;
35
35
  APP_DIR: string;
36
- DOCKER_DIR: string;
36
+ DOCKER_BUILD_CONTEXT: string;
37
37
  DOCKERFILE_ADDITIONS?: undefined;
38
38
  DOCKERFILE_ADDITIONS_END?: undefined;
39
39
  } | {
@@ -42,7 +42,7 @@ export declare const getDockerBuildVariables: (context: ComponentContext) => {
42
42
  DOCKER_IMAGE: import("../bash/BashExpression").StringOrBashExpression;
43
43
  DOCKER_CACHE_IMAGE: string;
44
44
  APP_DIR: string;
45
- DOCKER_DIR: string;
45
+ DOCKER_BUILD_CONTEXT: string;
46
46
  DOCKERFILE_ADDITIONS: string | undefined;
47
47
  DOCKERFILE_ADDITIONS_END: string | undefined;
48
48
  } | {
@@ -52,7 +52,7 @@ export declare const getDockerBuildVariables: (context: ComponentContext) => {
52
52
  DOCKER_IMAGE_NAME: string;
53
53
  DOCKER_IMAGE: string;
54
54
  APP_DIR: string;
55
- DOCKER_DIR: string;
55
+ DOCKER_BUILD_CONTEXT: string;
56
56
  DOCKERFILE_ADDITIONS: string | undefined;
57
57
  DOCKERFILE_ADDITIONS_END: string | undefined;
58
58
  };
@@ -120,9 +120,10 @@ var getDockerAdditions = function (build) {
120
120
  };
121
121
  };
122
122
  var getDockerBuildVariables = function (context) {
123
+ var _a;
123
124
  return __assign(__assign(__assign({}, getDockerAdditions(context.build.config)), {
124
125
  APP_DIR: context.build.dir,
125
- DOCKER_DIR: "."
126
+ DOCKER_BUILD_CONTEXT: "docker" in context.build.config && context.build.config.docker && "buildContextLocation" in context.build.config.docker && ((_a = context.build.config.docker) === null || _a === void 0 ? void 0 : _a.buildContextLocation) === "component" ? context.build.dir : "."
126
127
  }), (0, exports.getDockerImageVariables)(context));
127
128
  };
128
129
  exports.getDockerBuildVariables = getDockerBuildVariables;
@@ -172,7 +173,7 @@ var getDockerBuildScriptWithBuiltInDockerFile = function (context, defaultType)
172
173
  };
173
174
  exports.getDockerBuildScriptWithBuiltInDockerFile = getDockerBuildScriptWithBuiltInDockerFile;
174
175
  var getDockerBuildDefaultScript = function (context, ensureDockerFileScript) {
175
- return __spreadArray(__spreadArray(__spreadArray([ensureDockerFileScript !== null && ensureDockerFileScript !== void 0 ? ensureDockerFileScript : undefined], __read((0, gitlab_1.collapseableSection)("docker-login", "Docker Login")((0, exports.gitlabDockerLogin)(context))), false), __read((0, gitlab_1.collapseableSection)("docker-build", "Docker build")(["docker build --network host --cache-from $DOCKER_CACHE_IMAGE --tag $DOCKER_IMAGE:$DOCKER_IMAGE_TAG -f $APP_DIR/Dockerfile . --build-arg BUILDKIT_INLINE_CACHE=1" //BUILDKIT_INLINE_CACHE, see https://testdriven.io/blog/faster-ci-builds-with-docker-cache/
176
+ return __spreadArray(__spreadArray(__spreadArray([ensureDockerFileScript !== null && ensureDockerFileScript !== void 0 ? ensureDockerFileScript : undefined], __read((0, gitlab_1.collapseableSection)("docker-login", "Docker Login")((0, exports.gitlabDockerLogin)(context))), false), __read((0, gitlab_1.collapseableSection)("docker-build", "Docker build")(["docker build --network host --cache-from $DOCKER_CACHE_IMAGE --tag $DOCKER_IMAGE:$DOCKER_IMAGE_TAG -f $APP_DIR/Dockerfile $DOCKER_BUILD_CONTEXT --build-arg BUILDKIT_INLINE_CACHE=1" //BUILDKIT_INLINE_CACHE, see https://testdriven.io/blog/faster-ci-builds-with-docker-cache/
176
177
  ])), false), __read((0, gitlab_1.collapseableSection)("docker-push", "Docker push and tag")(["docker push $DOCKER_IMAGE:$DOCKER_IMAGE_TAG", "docker tag $DOCKER_IMAGE:$DOCKER_IMAGE_TAG $DOCKER_CACHE_IMAGE", "docker push $DOCKER_CACHE_IMAGE"])), false).filter(Boolean);
177
178
  };
178
179
  exports.getDockerBuildDefaultScript = getDockerBuildDefaultScript;
@@ -142,6 +142,10 @@ type BuildConfigDockerCustom = {
142
142
  * custom docker build, expect that a Dockerfile in your directory
143
143
  */
144
144
  type: "custom";
145
+ /**
146
+ * where to run the docker build, defaults to the root of the repo
147
+ */
148
+ buildContextLocation?: "root" | "component";
145
149
  };
146
150
  export type BuildConfigDocker = BuildConfigDockerBuiltIn | BuildConfigDockerCustom;
147
151
  /**