@catladder/pipeline 0.0.0-node16-ddfae617 → 0.0.0-refactor-env-context-9e652b63
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/bin/catladder-gitlab.js +1 -1
- package/dist/build/base/createBuildJob.d.ts +2 -2
- package/dist/build/base/getBuildInfo.d.ts +1 -1
- package/dist/build/docker.d.ts +44 -6
- package/dist/build/docker.js +45 -19
- package/dist/build/index.d.ts +6 -5
- package/dist/build/node/buildJob.d.ts +2 -2
- package/dist/build/node/cache.d.ts +2 -2
- package/dist/build/node/index.d.ts +1 -1
- package/dist/build/node/meteor.d.ts +1 -1
- package/dist/build/node/meteor.js +6 -0
- package/dist/build/node/testJob.d.ts +2 -2
- package/dist/build/node/testJob.js +3 -0
- package/dist/build/node/yarn.d.ts +1 -1
- package/dist/build/node/yarn.js +13 -1
- package/dist/build/types.d.ts +10 -0
- package/dist/bundles/catladder-gitlab/index.js +32457 -0
- package/dist/catladder-gitlab.js +1 -2
- package/dist/config/configruedEnvs.d.ts +1 -1
- package/dist/config/readConfig.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/context/getEnvConfig.d.ts +9 -0
- package/dist/context/getEnvConfig.js +26 -0
- package/dist/context/getEnvType.d.ts +4 -0
- package/dist/context/getEnvType.js +18 -0
- package/dist/context/getEnvironment.d.ts +3 -0
- package/dist/context/getEnvironment.js +187 -0
- package/dist/context/getEnvironmentContext.d.ts +4 -0
- package/dist/context/getEnvironmentContext.js +36 -0
- package/dist/context/getEnvironmentVariables.d.ts +10 -0
- package/dist/context/getEnvironmentVariables.js +322 -0
- package/dist/context/getLabels.d.ts +8 -0
- package/dist/context/getLabels.js +49 -0
- package/dist/context/index.d.ts +5 -6
- package/dist/context/index.js +176 -181
- package/dist/context/resolveReferences.d.ts +1 -3
- package/dist/context/resolveReferences.js +275 -26
- package/dist/context/resolveReferences.test.js +332 -81
- package/dist/defaults/index.d.ts +1 -1
- package/dist/deploy/base.d.ts +4 -2
- package/dist/deploy/base.js +37 -17
- package/dist/deploy/cloudRun/deployJob.d.ts +3 -0
- package/dist/deploy/cloudRun/deployJob.js +139 -0
- package/dist/deploy/cloudRun/index.d.ts +9 -0
- package/dist/deploy/cloudRun/index.js +56 -0
- package/dist/deploy/cloudRun/utils/gcloudServiceAccountLoginCommands.d.ts +2 -0
- package/dist/deploy/cloudRun/utils/gcloudServiceAccountLoginCommands.js +14 -0
- package/dist/deploy/cloudSql/index.d.ts +8 -0
- package/dist/deploy/cloudSql/index.js +30 -0
- package/dist/deploy/custom/deployJob.d.ts +2 -2
- package/dist/deploy/custom/deployJob.js +4 -1
- package/dist/deploy/custom/index.d.ts +2 -1
- package/dist/deploy/custom/index.js +15 -18
- package/dist/deploy/dockerTag/deployJob.d.ts +3 -0
- package/dist/deploy/dockerTag/deployJob.js +33 -0
- package/dist/deploy/dockerTag/index.d.ts +2 -0
- package/dist/deploy/dockerTag/index.js +19 -0
- package/dist/deploy/index.d.ts +12 -8
- package/dist/deploy/index.js +27 -14
- package/dist/deploy/kubernetes/additionalSecretKeys.d.ts +4 -0
- package/dist/deploy/kubernetes/additionalSecretKeys.js +33 -0
- package/dist/deploy/kubernetes/cloudsql.d.ts +1 -1
- package/dist/deploy/kubernetes/deployJob.d.ts +2 -2
- package/dist/deploy/kubernetes/deployJob.js +13 -66
- package/dist/deploy/kubernetes/index.d.ts +2 -1
- package/dist/deploy/kubernetes/index.js +45 -16
- package/dist/deploy/kubernetes/kubeEnv.d.ts +10 -0
- package/dist/deploy/kubernetes/kubeEnv.js +90 -0
- package/dist/deploy/kubernetes/kubeValues.d.ts +90 -0
- package/dist/deploy/kubernetes/kubeValues.js +96 -0
- package/dist/deploy/kubernetes/mongodb.d.ts +18 -5
- package/dist/deploy/kubernetes/mongodb.js +118 -8
- package/dist/deploy/kubernetes/processSecretsAsFiles.d.ts +21 -21
- package/dist/deploy/types/base.d.ts +15 -0
- package/dist/deploy/types/base.js +3 -0
- package/dist/deploy/types/custom.d.ts +27 -0
- package/dist/deploy/types/custom.js +3 -0
- package/dist/deploy/types/dockerTag.d.ts +10 -0
- package/dist/deploy/types/dockerTag.js +3 -0
- package/dist/deploy/types/googleCloudRun.d.ts +39 -0
- package/dist/deploy/types/googleCloudRun.js +3 -0
- package/dist/deploy/types/index.d.ts +24 -0
- package/dist/deploy/types/index.js +41 -0
- package/dist/deploy/{types.d.ts → types/kubernetes.d.ts} +128 -36
- package/dist/deploy/types/kubernetes.js +3 -0
- package/dist/deploy/utils.d.ts +2 -2
- package/dist/deploy/utils.js +4 -0
- package/dist/pipeline/createChildPipeline.d.ts +2 -2
- package/dist/pipeline/createChildPipeline.js +3 -3
- package/dist/pipeline/createJobs.d.ts +2 -2
- package/dist/pipeline/createJobs.js +63 -25
- package/dist/pipeline/gitlab/makeGitlabJob.d.ts +3 -2
- package/dist/pipeline/gitlab/makeGitlabJob.js +2 -1
- package/dist/pipeline/packageManager.d.ts +1 -1
- package/dist/rules/index.d.ts +1 -1
- package/dist/runner/index.d.ts +2 -3
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/config.d.ts +7 -6
- package/dist/types/config.js +1 -1
- package/dist/types/context.d.ts +10 -2
- package/dist/types/environmentContext.d.ts +22 -0
- package/dist/types/environmentContext.js +3 -0
- package/dist/types/gitlab-types.d.ts +1 -1
- package/dist/types/jobs.d.ts +8 -3
- package/dist/types/jobs.js +1 -1
- package/dist/types/pipeline.d.ts +1 -1
- package/package.json +15 -11
- package/scripts/bundle +2 -0
- package/src/build/base/createBuildJob.ts +3 -2
- package/src/build/base/getBuildInfo.ts +1 -1
- package/src/build/docker.ts +47 -29
- package/src/build/index.ts +8 -5
- package/src/build/node/buildJob.ts +2 -2
- package/src/build/node/cache.ts +2 -2
- package/src/build/node/index.ts +1 -1
- package/src/build/node/meteor.ts +8 -2
- package/src/build/node/testJob.ts +4 -2
- package/src/build/node/yarn.ts +21 -10
- package/src/build/tests/storybook.test.ts +1 -1
- package/src/build/types.ts +13 -1
- package/src/catladder-gitlab.ts +4 -2
- package/src/config/configruedEnvs.test.ts +2 -2
- package/src/config/configruedEnvs.ts +5 -4
- package/src/config/readConfig.ts +1 -1
- package/src/context/getEnvConfig.ts +21 -0
- package/src/context/getEnvType.ts +17 -0
- package/src/context/getEnvironment.ts +40 -0
- package/src/context/getEnvironmentContext.ts +57 -0
- package/src/context/getEnvironmentVariables.ts +152 -0
- package/src/context/getLabels.ts +20 -0
- package/src/context/index.ts +25 -191
- package/src/context/resolveReferences.test.ts +15 -15
- package/src/context/resolveReferences.ts +37 -30
- package/src/defaults/index.ts +1 -1
- package/src/deploy/base.ts +43 -19
- package/src/deploy/cloudRun/deployJob.ts +104 -0
- package/src/deploy/cloudRun/index.ts +48 -0
- package/src/deploy/cloudRun/utils/gcloudServiceAccountLoginCommands.ts +14 -0
- package/src/deploy/cloudSql/index.ts +16 -0
- package/src/deploy/custom/deployJob.ts +10 -3
- package/src/deploy/custom/index.ts +9 -1
- package/src/deploy/dockerTag/deployJob.ts +31 -0
- package/src/deploy/dockerTag/index.ts +9 -0
- package/src/deploy/index.ts +26 -17
- package/src/deploy/kubernetes/additionalSecretKeys.ts +23 -0
- package/src/deploy/kubernetes/cloudsql.ts +2 -1
- package/src/deploy/kubernetes/deployJob.ts +19 -77
- package/src/deploy/kubernetes/index.ts +42 -1
- package/src/deploy/kubernetes/kubeEnv.ts +48 -0
- package/src/deploy/kubernetes/kubeValues.ts +82 -0
- package/src/deploy/kubernetes/mongodb.ts +104 -7
- package/src/deploy/kubernetes/processSecretsAsFiles.ts +1 -1
- package/src/deploy/types/base.ts +17 -0
- package/src/deploy/types/custom.ts +24 -0
- package/src/deploy/types/dockerTag.ts +12 -0
- package/src/deploy/types/googleCloudRun.ts +79 -0
- package/src/deploy/types/index.ts +28 -0
- package/src/deploy/types/kubernetes.ts +281 -0
- package/src/deploy/utils.ts +6 -2
- package/src/pipeline/createChildPipeline.test.ts +1 -1
- package/src/pipeline/createChildPipeline.ts +4 -4
- package/src/pipeline/createJobs.ts +32 -21
- package/src/pipeline/gitlab/makeGitlabJob.ts +3 -2
- package/src/pipeline/packageManager.ts +1 -1
- package/src/rules/index.ts +1 -1
- package/src/runner/index.ts +2 -1
- package/src/types/config.ts +8 -6
- package/src/types/context.ts +14 -2
- package/src/types/environmentContext.ts +26 -0
- package/src/types/gitlab-types.ts +1 -1
- package/src/types/jobs.ts +9 -2
- package/src/types/pipeline.ts +1 -1
- package/tsconfig.json +2 -0
- package/dist/deploy/types.js +0 -16
- package/src/deploy/types.ts +0 -189
package/bin/catladder-gitlab.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Context } from "../../types";
|
|
1
|
+
import type { Context } from "../../types";
|
|
2
2
|
export declare const getBuildInfo: (context: Context) => string[];
|
package/dist/build/docker.d.ts
CHANGED
|
@@ -1,7 +1,21 @@
|
|
|
1
|
-
import { Context } from "../types";
|
|
2
|
-
import { CatladderJob } from "../types/jobs";
|
|
1
|
+
import type { Context } from "../types";
|
|
2
|
+
import type { CatladderJob } from "../types/jobs";
|
|
3
|
+
export declare const getDockerImageVariables: (context: Context) => {
|
|
4
|
+
DOCKER_REGISTRY: string;
|
|
5
|
+
DOCKER_REGISTRY_IMAGE_PATH: string;
|
|
6
|
+
DOCKER_CACHE_IMAGE: string;
|
|
7
|
+
DOCKER_IMAGE_NAME: string;
|
|
8
|
+
DOCKER_IMAGE: string;
|
|
9
|
+
DOCKER_IMAGE_TAG: string;
|
|
10
|
+
};
|
|
3
11
|
export declare const requiresDockerBuild: (context: Context) => boolean;
|
|
4
12
|
export declare const getDockerBuildVariables: (context: Context) => {
|
|
13
|
+
DOCKER_REGISTRY: string;
|
|
14
|
+
DOCKER_REGISTRY_IMAGE_PATH: string;
|
|
15
|
+
DOCKER_CACHE_IMAGE: string;
|
|
16
|
+
DOCKER_IMAGE_NAME: string;
|
|
17
|
+
DOCKER_IMAGE: string;
|
|
18
|
+
DOCKER_IMAGE_TAG: string;
|
|
5
19
|
DOCKER_BUILDKIT: string;
|
|
6
20
|
DOCKERFILE_ADDITIONS: string | undefined;
|
|
7
21
|
DOCKERFILE_ADDITIONS_END: string | undefined;
|
|
@@ -9,21 +23,45 @@ export declare const getDockerBuildVariables: (context: Context) => {
|
|
|
9
23
|
DOCKER_HOST: string;
|
|
10
24
|
DOCKER_TLS_CERTDIR: string;
|
|
11
25
|
DOCKER_DIR: string;
|
|
12
|
-
IMAGE_TAG: string;
|
|
13
26
|
DOCKER_DRIVER: string;
|
|
14
|
-
IMAGE_NAME: string;
|
|
15
|
-
CACHE_IMAGE: string;
|
|
16
27
|
KUBERNETES_CPU_REQUEST: string;
|
|
17
28
|
KUBERNETES_CPU_LIMIT: string;
|
|
18
29
|
KUBERNETES_MEMORY_REQUEST: string;
|
|
19
30
|
KUBERNETES_MEMORY_LIMIT: string;
|
|
20
31
|
};
|
|
21
32
|
export declare const DOCKER_BUILD_JOB_NAME = "\uD83D\uDD28 docker";
|
|
33
|
+
export declare const getDockerJobBaseProps: (context: Context) => {
|
|
34
|
+
image: string;
|
|
35
|
+
services: {
|
|
36
|
+
name: string;
|
|
37
|
+
command: string[];
|
|
38
|
+
}[];
|
|
39
|
+
variables: {
|
|
40
|
+
DOCKER_REGISTRY: string;
|
|
41
|
+
DOCKER_REGISTRY_IMAGE_PATH: string;
|
|
42
|
+
DOCKER_CACHE_IMAGE: string;
|
|
43
|
+
DOCKER_IMAGE_NAME: string;
|
|
44
|
+
DOCKER_IMAGE: string;
|
|
45
|
+
DOCKER_IMAGE_TAG: string;
|
|
46
|
+
DOCKER_BUILDKIT: string;
|
|
47
|
+
DOCKERFILE_ADDITIONS: string | undefined;
|
|
48
|
+
DOCKERFILE_ADDITIONS_END: string | undefined;
|
|
49
|
+
APP_DIR: string;
|
|
50
|
+
DOCKER_HOST: string;
|
|
51
|
+
DOCKER_TLS_CERTDIR: string;
|
|
52
|
+
DOCKER_DIR: string;
|
|
53
|
+
DOCKER_DRIVER: string;
|
|
54
|
+
KUBERNETES_CPU_REQUEST: string;
|
|
55
|
+
KUBERNETES_CPU_LIMIT: string;
|
|
56
|
+
KUBERNETES_MEMORY_REQUEST: string;
|
|
57
|
+
KUBERNETES_MEMORY_LIMIT: string;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
22
60
|
export declare const createDockerBuildJobBase: (context: Context, {
|
|
23
61
|
script,
|
|
24
|
-
variables,
|
|
25
62
|
...def
|
|
26
63
|
}: Partial<CatladderJob>) => CatladderJob;
|
|
64
|
+
export declare const gitlabDockerLogin = "docker login --username gitlab-ci-token --password $CI_JOB_TOKEN $CI_REGISTRY";
|
|
27
65
|
export declare const createDockerBuildJobDefault: (context: Context, {
|
|
28
66
|
script,
|
|
29
67
|
...def
|
package/dist/build/docker.js
CHANGED
|
@@ -61,7 +61,7 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
|
|
|
61
61
|
};
|
|
62
62
|
|
|
63
63
|
exports.__esModule = true;
|
|
64
|
-
exports.createDockerBuildJobDefault = exports.createDockerBuildJobBase = exports.DOCKER_BUILD_JOB_NAME = exports.getDockerBuildVariables = exports.requiresDockerBuild = void 0;
|
|
64
|
+
exports.createDockerBuildJobDefault = exports.gitlabDockerLogin = exports.createDockerBuildJobBase = exports.getDockerJobBaseProps = exports.DOCKER_BUILD_JOB_NAME = exports.getDockerBuildVariables = exports.requiresDockerBuild = exports.getDockerImageVariables = void 0;
|
|
65
65
|
|
|
66
66
|
var lodash_1 = require("lodash");
|
|
67
67
|
|
|
@@ -76,6 +76,19 @@ var DOCKER_RUNNER_BUILD_VARIABLES = {
|
|
|
76
76
|
KUBERNETES_MEMORY_LIMIT: "2Gi"
|
|
77
77
|
};
|
|
78
78
|
|
|
79
|
+
var getDockerImageVariables = function (context) {
|
|
80
|
+
return {
|
|
81
|
+
DOCKER_REGISTRY: "$CI_REGISTRY",
|
|
82
|
+
DOCKER_REGISTRY_IMAGE_PATH: "$CI_REGISTRY_IMAGE",
|
|
83
|
+
DOCKER_CACHE_IMAGE: "$DOCKER_REGISTRY_IMAGE_PATH/caches/" + context.componentName,
|
|
84
|
+
DOCKER_IMAGE_NAME: context.environment.shortName + "/" + context.componentName,
|
|
85
|
+
DOCKER_IMAGE: "$DOCKER_REGISTRY_IMAGE_PATH/$DOCKER_IMAGE_NAME",
|
|
86
|
+
DOCKER_IMAGE_TAG: "$CI_COMMIT_SHA"
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
exports.getDockerImageVariables = getDockerImageVariables;
|
|
91
|
+
|
|
79
92
|
var requiresDockerBuild = function (context) {
|
|
80
93
|
var deployConfig = context.componentConfig.deploy;
|
|
81
94
|
|
|
@@ -83,10 +96,18 @@ var requiresDockerBuild = function (context) {
|
|
|
83
96
|
return true;
|
|
84
97
|
}
|
|
85
98
|
|
|
99
|
+
if ((0, deploy_1.isOfDeployType)(deployConfig, "google-cloudrun")) {
|
|
100
|
+
return true;
|
|
101
|
+
}
|
|
102
|
+
|
|
86
103
|
if ((0, deploy_1.isOfDeployType)(deployConfig, "custom") && deployConfig.requiresDocker) {
|
|
87
104
|
return true;
|
|
88
105
|
}
|
|
89
106
|
|
|
107
|
+
if ((0, deploy_1.isOfDeployType)(deployConfig, "dockerTag")) {
|
|
108
|
+
return true;
|
|
109
|
+
}
|
|
110
|
+
|
|
90
111
|
return false;
|
|
91
112
|
};
|
|
92
113
|
|
|
@@ -95,7 +116,7 @@ exports.requiresDockerBuild = requiresDockerBuild;
|
|
|
95
116
|
var getDockerBuildVariables = function (context) {
|
|
96
117
|
var _a, _b, _c, _d;
|
|
97
118
|
|
|
98
|
-
return __assign(__assign({}, DOCKER_RUNNER_BUILD_VARIABLES), {
|
|
119
|
+
return __assign(__assign(__assign({}, DOCKER_RUNNER_BUILD_VARIABLES), {
|
|
99
120
|
DOCKER_BUILDKIT: "1",
|
|
100
121
|
DOCKERFILE_ADDITIONS: (_b = (_a = context.componentConfig.build.docker) === null || _a === void 0 ? void 0 : _a.additionsBegin) === null || _b === void 0 ? void 0 : _b.join("\n"),
|
|
101
122
|
DOCKERFILE_ADDITIONS_END: (_d = (_c = context.componentConfig.build.docker) === null || _c === void 0 ? void 0 : _c.additionsEnd) === null || _d === void 0 ? void 0 : _d.join("\n"),
|
|
@@ -103,43 +124,48 @@ var getDockerBuildVariables = function (context) {
|
|
|
103
124
|
DOCKER_HOST: "tcp://0.0.0.0:2375",
|
|
104
125
|
DOCKER_TLS_CERTDIR: "",
|
|
105
126
|
DOCKER_DIR: ".",
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
IMAGE_NAME: "$CI_REGISTRY_IMAGE/" + context.environment.shortName + "/" + context.componentName,
|
|
109
|
-
CACHE_IMAGE: "$CI_REGISTRY_IMAGE/caches/" + context.componentName
|
|
110
|
-
});
|
|
127
|
+
DOCKER_DRIVER: "overlay2"
|
|
128
|
+
}), (0, exports.getDockerImageVariables)(context));
|
|
111
129
|
};
|
|
112
130
|
|
|
113
131
|
exports.getDockerBuildVariables = getDockerBuildVariables;
|
|
114
132
|
exports.DOCKER_BUILD_JOB_NAME = "🔨 docker";
|
|
115
133
|
|
|
116
|
-
var
|
|
117
|
-
|
|
118
|
-
variables = _a.variables,
|
|
119
|
-
def = __rest(_a, ["script", "variables"]);
|
|
120
|
-
|
|
121
|
-
return (0, lodash_1.merge)({
|
|
122
|
-
name: exports.DOCKER_BUILD_JOB_NAME,
|
|
123
|
-
envMode: "jobPerEnv",
|
|
124
|
-
stage: "build",
|
|
134
|
+
var getDockerJobBaseProps = function (context) {
|
|
135
|
+
return {
|
|
125
136
|
image: (0, runner_1.getRunnerImage)("docker-build"),
|
|
126
137
|
services: [{
|
|
127
138
|
name: "docker:20-dind",
|
|
128
139
|
command: ["--tls=false"]
|
|
129
140
|
}],
|
|
130
|
-
variables:
|
|
141
|
+
variables: (0, exports.getDockerBuildVariables)(context)
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
exports.getDockerJobBaseProps = getDockerJobBaseProps;
|
|
146
|
+
|
|
147
|
+
var createDockerBuildJobBase = function (context, _a) {
|
|
148
|
+
var script = _a.script,
|
|
149
|
+
def = __rest(_a, ["script"]);
|
|
150
|
+
|
|
151
|
+
return (0, lodash_1.merge)(__assign(__assign({
|
|
152
|
+
name: exports.DOCKER_BUILD_JOB_NAME,
|
|
153
|
+
envMode: "jobPerEnv",
|
|
154
|
+
stage: "build"
|
|
155
|
+
}, (0, exports.getDockerJobBaseProps)(context)), {
|
|
131
156
|
script: script || []
|
|
132
|
-
}, def);
|
|
157
|
+
}), def);
|
|
133
158
|
};
|
|
134
159
|
|
|
135
160
|
exports.createDockerBuildJobBase = createDockerBuildJobBase;
|
|
161
|
+
exports.gitlabDockerLogin = "docker login --username gitlab-ci-token --password $CI_JOB_TOKEN $CI_REGISTRY";
|
|
136
162
|
|
|
137
163
|
var createDockerBuildJobDefault = function (context, _a) {
|
|
138
164
|
var script = _a.script,
|
|
139
165
|
def = __rest(_a, ["script"]);
|
|
140
166
|
|
|
141
167
|
return (0, exports.createDockerBuildJobBase)(context, __assign({
|
|
142
|
-
script: __spreadArray(__spreadArray([], __read(script || []), false), ["docker
|
|
168
|
+
script: __spreadArray(__spreadArray([], __read(script || []), false), [exports.gitlabDockerLogin, "docker version", "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", "docker push $DOCKER_IMAGE:$DOCKER_IMAGE_TAG", "docker tag $DOCKER_IMAGE:$DOCKER_IMAGE_TAG $DOCKER_CACHE_IMAGE", "docker push $DOCKER_CACHE_IMAGE"], false)
|
|
143
169
|
}, def));
|
|
144
170
|
};
|
|
145
171
|
|
package/dist/build/index.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { Context } from "../types/context";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import type { Context } from "../types/context";
|
|
2
|
+
import type { EnvironmentContext } from "../types/environmentContext";
|
|
3
|
+
import type { CatladderJob } from "../types/jobs";
|
|
4
|
+
import type { BuildConfig, BuildConfigType } from "./types";
|
|
4
5
|
export * from "./types";
|
|
5
6
|
export * from "./node";
|
|
6
|
-
export declare type BuildTypes = { [type in
|
|
7
|
+
export declare type BuildTypes = { [type in BuildConfigType]: {
|
|
7
8
|
jobs: (context: Context) => CatladderJob[];
|
|
8
|
-
defaults: () => Partial<Extract<BuildConfig, {
|
|
9
|
+
defaults: (envVarContext: EnvironmentContext<BuildConfigType, any>) => Partial<Extract<BuildConfig, {
|
|
9
10
|
type: type;
|
|
10
11
|
}>>;
|
|
11
12
|
} };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Context } from "../../types/context";
|
|
2
|
-
import { CatladderJob } from "../../types/jobs";
|
|
1
|
+
import type { Context } from "../../types/context";
|
|
2
|
+
import type { CatladderJob } from "../../types/jobs";
|
|
3
3
|
export declare const createNodeBuildJobs: (context: Context) => CatladderJob[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Context } from "../../types/context";
|
|
2
|
-
import { GitlabJobCache } from "../../types/gitlab-types";
|
|
1
|
+
import type { Context } from "../../types/context";
|
|
2
|
+
import type { GitlabJobCache } from "../../types/gitlab-types";
|
|
3
3
|
export declare const getYarnCache: (context: Context, policy?: string) => GitlabJobCache[];
|
|
4
4
|
export declare const getNodeModulesCache: (context: Context, policy?: string) => GitlabJobCache[];
|
|
5
5
|
export declare const getNodeCache: (context: Context, policy?: string) => GitlabJobCache[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Context } from "../../types/context";
|
|
2
|
-
import { CatladderJob } from "../../types/jobs";
|
|
2
|
+
import type { CatladderJob } from "../../types/jobs";
|
|
3
3
|
export declare const createNodeJobs: (context: Context) => CatladderJob[];
|
|
4
4
|
export declare const createStorybookJobs: (context: Context) => CatladderJob[];
|
|
5
5
|
export declare const createMeteorJobs: (context: Context) => CatladderJob[];
|
|
@@ -73,6 +73,9 @@ var createMeteorBuildJobs = function (context) {
|
|
|
73
73
|
var appBuildJob = buildConfig.buildCommand !== null ? (0, createBuildJob_1.createBuildJob)(context, {
|
|
74
74
|
cache: __spreadArray(__spreadArray([], __read((0, cache_1.getNodeCache)(context)), false), __read(getMeteorCache(context)), false),
|
|
75
75
|
image: (0, runner_1.getRunnerImage)("jobs-meteor"),
|
|
76
|
+
variables: {
|
|
77
|
+
METEOR_DISABLE_OPTIMISTIC_CACHING: "1"
|
|
78
|
+
},
|
|
76
79
|
script: __spreadArray(__spreadArray([], __read(yarnInstall), false), ['echo "add healthcheck package"', "meteor add panter:healthroute --allow-superuser", "meteor add qualia:prod-shell --allow-superuser", 'TOOL_NODE_FLAGS="--max_old_space_size=3584 --min_semi_space_size=8 --max_semi_space_size=256 --optimize_for_size" meteor build ./dist --architecture os.linux.x86_64 --allow-superuser --server-only --directory', "cp ./__build_info.json ./dist/bundle/programs/server"], false),
|
|
77
80
|
artifacts: {
|
|
78
81
|
paths: [context.componentConfig.dir + "/__build_info.json", context.componentConfig.dir + "/dist"]
|
|
@@ -80,6 +83,9 @@ var createMeteorBuildJobs = function (context) {
|
|
|
80
83
|
}) : null;
|
|
81
84
|
return __spreadArray(__spreadArray([], __read(appBuildJob ? [appBuildJob] : []), false), [(0, docker_1.createDockerBuildJobDefault)(context, {
|
|
82
85
|
script: ["ensureMeteorDockerfile"],
|
|
86
|
+
variables: {
|
|
87
|
+
METEOR_INSTALL_SCRIPTS: buildConfig.installScripts ? "true" : ""
|
|
88
|
+
},
|
|
83
89
|
needs: appBuildJob ? [constants_1.APP_BUILD_JOB_NAME] : []
|
|
84
90
|
})], false);
|
|
85
91
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Context } from "../../types/context";
|
|
2
|
-
import { CatladderJob } from "../../types/jobs";
|
|
1
|
+
import type { Context } from "../../types/context";
|
|
2
|
+
import type { CatladderJob } from "../../types/jobs";
|
|
3
3
|
export declare const createNodeTestJobs: (context: Context) => CatladderJob[];
|
|
@@ -52,6 +52,8 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
|
|
|
52
52
|
exports.__esModule = true;
|
|
53
53
|
exports.createNodeTestJobs = void 0;
|
|
54
54
|
|
|
55
|
+
var runner_1 = require("../../runner");
|
|
56
|
+
|
|
55
57
|
var utils_1 = require("../../utils");
|
|
56
58
|
|
|
57
59
|
var cache_1 = require("./cache");
|
|
@@ -95,6 +97,7 @@ var createNodeTestJobs = function (context) {
|
|
|
95
97
|
var testJob = buildConfig.test !== false ? __assign(__assign({
|
|
96
98
|
name: "🧪 test"
|
|
97
99
|
}, base), {
|
|
100
|
+
image: (0, runner_1.getRunnerImage)("jobs-testing-chrome"),
|
|
98
101
|
cache: (0, cache_1.getNodeCache)(context),
|
|
99
102
|
script: __spreadArray(__spreadArray(["cd ".concat(context.componentConfig.dir)], __read(yarnInstall), false), __read((_j = (0, utils_1.ensureArray)((_h = buildConfig.test) === null || _h === void 0 ? void 0 : _h.command)) !== null && _j !== void 0 ? _j : ["yarn test"]), false)
|
|
100
103
|
}) : null;
|
package/dist/build/node/yarn.js
CHANGED
|
@@ -41,7 +41,19 @@ exports.getYarnInstall = exports.ensureNodeVersion = exports.getYarnInstallComma
|
|
|
41
41
|
var getYarnInstallCommand = function (context, options) {
|
|
42
42
|
var _a;
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
if ((_a = context.packageManagerInfo) === null || _a === void 0 ? void 0 : _a.isClassic) {
|
|
45
|
+
return "yarn install --frozen-lockfile ".concat((options === null || options === void 0 ? void 0 : options.prodOnly) ? "--production" : "", " ").concat((options === null || options === void 0 ? void 0 : options.noScripts) ? "--ignore-scripts" : "");
|
|
46
|
+
} // is modern
|
|
47
|
+
// yarn >= 4 ships with build in plugins, see https://github.com/yarnpkg/berry/pull/4253
|
|
48
|
+
// trying to import those fail on this version
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
var doesNotShipWithBuiltInPlugins = ["2", "3"].some(function (v) {
|
|
52
|
+
var _a;
|
|
53
|
+
|
|
54
|
+
return (_a = context.packageManagerInfo) === null || _a === void 0 ? void 0 : _a.version.startsWith(v);
|
|
55
|
+
});
|
|
56
|
+
return (options === null || options === void 0 ? void 0 : options.prodOnly) ? "".concat((options === null || options === void 0 ? void 0 : options.noScripts) ? "YARN_ENABLE_SCRIPTS=false " : "").concat(doesNotShipWithBuiltInPlugins ? "yarn plugin import workspace-tools && " : " ", "yarn workspaces focus --production") // needs yarn plugin import workspace-tools
|
|
45
57
|
: "".concat((options === null || options === void 0 ? void 0 : options.noScripts) ? "YARN_ENABLE_SCRIPTS=false " : "", "yarn install --immutable");
|
|
46
58
|
};
|
|
47
59
|
|
package/dist/build/types.d.ts
CHANGED
|
@@ -59,12 +59,22 @@ export declare type BuildConfigNodeStatic = BuildConfigNodeBase & {
|
|
|
59
59
|
};
|
|
60
60
|
export declare type BuildConfigMeteor = BuildConfigNodeBase & {
|
|
61
61
|
type: "meteor";
|
|
62
|
+
/**
|
|
63
|
+
* whether to run yarn install inside the source folder in the docker image.
|
|
64
|
+
* This is only required if you have custom scripts in your image
|
|
65
|
+
*/
|
|
66
|
+
|
|
67
|
+
installScripts?: boolean;
|
|
62
68
|
};
|
|
63
69
|
export declare type BuildConfigStorybook = BuildConfigNodeBase & {
|
|
64
70
|
type: "storybook";
|
|
65
71
|
startCommand?: never;
|
|
66
72
|
};
|
|
67
73
|
export declare type BuildConfig = BuildConfigNode | BuildConfigNodeStatic | BuildConfigStorybook | BuildConfigMeteor;
|
|
74
|
+
export declare type BuildConfigType = BuildConfig["type"];
|
|
75
|
+
export declare type BuildConfigGeneric<T extends BuildConfigType> = Extract<BuildConfig, {
|
|
76
|
+
type: T;
|
|
77
|
+
}>;
|
|
68
78
|
export declare const isOfBuildType: <T extends ("node" | "node-static" | "meteor" | "storybook")[]>(t: BuildConfig, ...types: T) => t is Extract<BuildConfigNode, {
|
|
69
79
|
type: T[number];
|
|
70
80
|
}> | Extract<BuildConfigNodeStatic, {
|