@catladder/pipeline 1.100.2 → 1.101.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.
- package/dist/build/node/buildJob.js +9 -8
- package/dist/build/node/yarn.js +1 -1
- package/dist/build/types.d.ts +8 -4
- package/dist/bundles/catladder-gitlab/index.js +3 -3
- package/dist/constants.js +1 -1
- package/dist/context/getEnvironmentVariables.js +4 -1
- package/dist/deploy/base.js +5 -4
- package/dist/deploy/types/base.d.ts +8 -0
- package/dist/pipeline/commitInfo/getBuildId.d.ts +6 -1
- package/dist/pipeline/commitInfo/getBuildId.js +22 -2
- package/dist/pipeline/commitInfo/getCommitInfo.js +4 -1
- package/dist/pipeline/gitlab/createGitlabJobs.d.ts +1 -0
- package/dist/pipeline/gitlab/createGitlabJobs.js +3 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/context.d.ts +1 -0
- package/dist/types/gitlab-types.d.ts +1 -0
- package/dist/types/jobs.d.ts +4 -0
- package/dist/utils/index.d.ts +1 -1
- package/examples/__snapshots__/cloud-run-memory-limit.ts.snap +80 -32
- package/examples/__snapshots__/cloud-run-no-cpu-throttling.ts.snap +80 -32
- package/examples/__snapshots__/cloud-run-non-public.ts.snap +80 -32
- package/examples/__snapshots__/cloud-run-with-sql-reuse-db.ts.snap +160 -64
- package/examples/__snapshots__/cloud-run-with-sql.ts.snap +160 -64
- package/examples/__snapshots__/custom-build-job-with-tests.ts.snap +64 -24
- package/examples/__snapshots__/custom-build-job.ts.snap +64 -24
- package/examples/__snapshots__/custom-deploy.ts.snap +64 -28
- package/examples/__snapshots__/custom-envs.ts.snap +56 -22
- package/examples/__snapshots__/custom-sbom-java.ts.snap +64 -24
- package/examples/__snapshots__/kubernetes-application-customization.ts.snap +148 -52
- package/examples/__snapshots__/kubernetes-with-cloud-sql-legacy.ts.snap +148 -52
- package/examples/__snapshots__/kubernetes-with-cloud-sql.ts.snap +148 -52
- package/examples/__snapshots__/kubernetes-with-jobs.ts.snap +296 -104
- package/examples/__snapshots__/kubernetes-with-mongodb.ts.snap +148 -52
- package/examples/__snapshots__/rails-k8s-with-worker.ts.snap +108 -36
- package/examples/__snapshots__/wait-for-other-deploy.ts.snap +120 -48
- package/package.json +1 -1
- package/src/build/node/buildJob.ts +6 -1
- package/src/build/node/yarn.ts +2 -1
- package/src/build/types.ts +10 -5
- package/src/context/getEnvironmentVariables.ts +4 -1
- package/src/deploy/base.ts +7 -2
- package/src/deploy/types/base.ts +10 -0
- package/src/pipeline/commitInfo/getBuildId.ts +11 -0
- package/src/pipeline/commitInfo/getCommitInfo.ts +2 -1
- package/src/pipeline/gitlab/createGitlabJobs.ts +2 -0
- package/src/types/context.ts +1 -0
- package/src/types/gitlab-types.ts +1 -0
- package/src/types/jobs.ts +5 -0
- package/src/utils/index.ts +1 -1
|
@@ -53,7 +53,7 @@ var cache_1 = require("./cache");
|
|
|
53
53
|
var constants_2 = require("./constants");
|
|
54
54
|
var yarn_1 = require("./yarn");
|
|
55
55
|
var createNodeBuildJobs = function (context) {
|
|
56
|
-
var _a, _b, _c, _d, _e;
|
|
56
|
+
var _a, _b, _c, _d, _e, _f;
|
|
57
57
|
var buildConfig = context.componentConfig.build;
|
|
58
58
|
if (!(0, types_1.isOfBuildType)(buildConfig, "node", "node-static", "storybook")) {
|
|
59
59
|
throw new Error("deploy config is not node, node-static or storybook");
|
|
@@ -61,13 +61,14 @@ var createNodeBuildJobs = function (context) {
|
|
|
61
61
|
var yarnInstall = (0, yarn_1.getYarnInstall)(context);
|
|
62
62
|
var appBuildJob = buildConfig.buildCommand !== null ? (0, createBuildJob_1.createBuildJob)(context, {
|
|
63
63
|
variables: __assign({}, constants_2.NODE_RUNNER_BUILD_VARIABLES),
|
|
64
|
-
cache: __spreadArray(__spreadArray([], __read((0, cache_1.getNodeCache)(context)), false), __read((0, cache_1.getNextCache)(context)), false),
|
|
65
|
-
script: __spreadArray(__spreadArray([], __read(yarnInstall), false), __read((
|
|
64
|
+
cache: __spreadArray(__spreadArray(__spreadArray([], __read((_a = (0, utils_1.ensureArray)(buildConfig.jobCache)) !== null && _a !== void 0 ? _a : []), false), __read((0, cache_1.getNodeCache)(context)), false), __read((0, cache_1.getNextCache)(context)), false),
|
|
65
|
+
script: __spreadArray(__spreadArray([], __read(yarnInstall), false), __read((_b = (0, utils_1.ensureArray)(buildConfig.buildCommand)) !== null && _b !== void 0 ? _b : []), false),
|
|
66
66
|
artifacts: {
|
|
67
|
-
paths: __spreadArray([(0, path_1.join)(context.componentConfig.dir, "__build_info.json"), (0, path_1.join)(context.componentConfig.dir, "dist"), (0, path_1.join)(context.componentConfig.dir, ".next")], __read((
|
|
67
|
+
paths: __spreadArray([(0, path_1.join)(context.componentConfig.dir, "__build_info.json"), (0, path_1.join)(context.componentConfig.dir, "dist"), (0, path_1.join)(context.componentConfig.dir, ".next")], __read((_d = (_c = buildConfig.artifactsPaths) === null || _c === void 0 ? void 0 : _c.map(function (path) {
|
|
68
68
|
return (0, path_1.join)(context.componentConfig.dir, path);
|
|
69
|
-
})) !== null &&
|
|
70
|
-
}
|
|
69
|
+
})) !== null && _d !== void 0 ? _d : []), false)
|
|
70
|
+
},
|
|
71
|
+
jobTags: buildConfig.jobTags
|
|
71
72
|
}) : null;
|
|
72
73
|
return __spreadArray(__spreadArray([], __read(appBuildJob ? [appBuildJob] : []), false), __read((0, docker_1.requiresDockerBuild)(context) ? [(0, docker_1.createDockerBuildJobDefault)(context, {
|
|
73
74
|
script: [buildConfig.type === "node-static" || buildConfig.type === "storybook" ? "ensureNginxDockerfile" : "ensureNodeDockerfile"],
|
|
@@ -75,9 +76,9 @@ var createNodeBuildJobs = function (context) {
|
|
|
75
76
|
variables: {
|
|
76
77
|
// only required for non static
|
|
77
78
|
DOCKER_COPY_AND_INSTALL_APP: (0, yarn_1.getDockerAppCopyAndBuildScript)(context),
|
|
78
|
-
DOCKER_COPY_WORKSPACE_FILES: (
|
|
79
|
+
DOCKER_COPY_WORKSPACE_FILES: (_f = (_e = context.packageManagerInfo) === null || _e === void 0 ? void 0 : _e.pathsToCopyInDocker.map(function (dir) {
|
|
79
80
|
return "COPY --chown=node:node ".concat(dir, " /app/").concat(dir);
|
|
80
|
-
})) === null ||
|
|
81
|
+
})) === null || _f === void 0 ? void 0 : _f.join("\n")
|
|
81
82
|
},
|
|
82
83
|
needs: appBuildJob ? [constants_1.APP_BUILD_JOB_NAME] : []
|
|
83
84
|
})] : []), false);
|
package/dist/build/node/yarn.js
CHANGED
|
@@ -44,7 +44,7 @@ var getYarnInstallCommand = function (context) {
|
|
|
44
44
|
return "yarn install --immutable";
|
|
45
45
|
};
|
|
46
46
|
var ensureNodeVersion = function (context) {
|
|
47
|
-
return ["if [ -f
|
|
47
|
+
return ["if [ -f ~/.nvm/nvm.sh ]; then source ~/.nvm/nvm.sh; fi", "if [ -f ./.nvmrc ]; then nvm install <<< .nvmrc; fi"];
|
|
48
48
|
};
|
|
49
49
|
exports.ensureNodeVersion = ensureNodeVersion;
|
|
50
50
|
var getYarnInstall = function (context) {
|
package/dist/build/types.d.ts
CHANGED
|
@@ -60,6 +60,14 @@ export declare type BuildConfigBase = {
|
|
|
60
60
|
* use to display information in merge requests, pipeline views and security dashboards.
|
|
61
61
|
*/
|
|
62
62
|
artifactsReports?: BuildConfigArtifactsReports;
|
|
63
|
+
/**
|
|
64
|
+
* customize cache for the job
|
|
65
|
+
*/
|
|
66
|
+
jobCache?: CatladderJob["cache"];
|
|
67
|
+
/**
|
|
68
|
+
* tags for the underlying job runner (e.g gitlab)
|
|
69
|
+
*/
|
|
70
|
+
jobTags?: string[];
|
|
63
71
|
};
|
|
64
72
|
export declare type BuildConfigNodeBase = BuildConfigBase;
|
|
65
73
|
export declare type BuildConfigNode = {
|
|
@@ -93,10 +101,6 @@ export declare type BuildConfigCustom = Omit<BuildConfigBase, "lint" | "test" |
|
|
|
93
101
|
jobImage: string;
|
|
94
102
|
jobServices?: GitlabJobService[];
|
|
95
103
|
docker: BuildConfigCustomDocker;
|
|
96
|
-
/**
|
|
97
|
-
* customize cache for the job
|
|
98
|
-
*/
|
|
99
|
-
jobCache?: CatladderJob["cache"];
|
|
100
104
|
/**
|
|
101
105
|
* custom lint, disabled when not set
|
|
102
106
|
*/
|