@catladder/pipeline 1.11.0 → 1.12.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/base/createBuildJob.d.ts +1 -0
- package/dist/build/base/createBuildJob.js +4 -3
- package/dist/build/docker.d.ts +5 -3
- package/dist/build/docker.js +45 -28
- package/dist/build/node/buildJob.js +26 -13
- package/dist/build/node/cache.d.ts +3 -1
- package/dist/build/node/cache.js +33 -5
- package/dist/build/node/meteor.js +4 -23
- package/dist/build/node/yarn.d.ts +4 -0
- package/dist/build/node/yarn.js +10 -3
- package/dist/build/types.d.ts +6 -0
- package/dist/constants.js +1 -1
- package/dist/context/index.d.ts +2 -2
- package/dist/context/index.js +2 -2
- package/dist/pipeline/createJobs.js +5 -5
- package/dist/pipeline/packageManager.d.ts +2 -0
- package/dist/pipeline/{yarnInfo.js → packageManager.js} +24 -12
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/context.d.ts +15 -11
- package/package.json +1 -1
- package/src/build/base/createBuildJob.ts +4 -2
- package/src/build/docker.ts +51 -45
- package/src/build/node/buildJob.ts +32 -22
- package/src/build/node/cache.ts +30 -5
- package/src/build/node/meteor.ts +5 -11
- package/src/build/node/yarn.ts +20 -3
- package/src/build/types.ts +6 -0
- package/src/context/index.ts +8 -4
- package/src/pipeline/createJobs.ts +3 -3
- package/src/pipeline/packageManager.ts +99 -0
- package/src/types/context.ts +14 -7
- package/dist/pipeline/yarnInfo.d.ts +0 -2
- package/src/pipeline/yarnInfo.ts +0 -73
|
@@ -79,19 +79,20 @@ var createBuildJob = function (context, _a) {
|
|
|
79
79
|
var _b, _c;
|
|
80
80
|
|
|
81
81
|
var script = _a.script,
|
|
82
|
-
|
|
82
|
+
variables = _a.variables,
|
|
83
|
+
def = __rest(_a, ["script", "variables"]);
|
|
83
84
|
|
|
84
85
|
return {
|
|
85
86
|
name: constants_1.APP_BUILD_JOB_NAME,
|
|
86
87
|
envMode: "jobPerEnv",
|
|
87
88
|
job: (0, lodash_1.merge)({
|
|
89
|
+
stage: "build",
|
|
88
90
|
image: (0, __1.getRunnerImage)("jobs-default"),
|
|
89
91
|
needs: [],
|
|
90
92
|
cache: [],
|
|
91
|
-
variables: __assign(__assign(__assign({}, constants_1.RUNNER_BUILD_RESOURCE_VARIABLES), context.environment.envVars), (_b = context.componentConfig.build.extraVars) !== null && _b !== void 0 ? _b : {}),
|
|
93
|
+
variables: __assign(__assign(__assign(__assign({}, constants_1.RUNNER_BUILD_RESOURCE_VARIABLES), variables !== null && variables !== void 0 ? variables : {}), context.environment.envVars), (_b = context.componentConfig.build.extraVars) !== null && _b !== void 0 ? _b : {}),
|
|
92
94
|
retry: defaults_1.BASE_RETRY,
|
|
93
95
|
interruptible: true,
|
|
94
|
-
stage: "build",
|
|
95
96
|
script: __spreadArray(__spreadArray(__spreadArray([], __read((0, getBuildInfo_1.getBuildInfo)(context)), false), ["cd ".concat(context.componentConfig.dir)], false), __read((_c = (0, utils_1.ensureArray)(script)) !== null && _c !== void 0 ? _c : []), false),
|
|
96
97
|
artifacts: {
|
|
97
98
|
paths: [context.componentConfig.dir + "/__build_info.json"]
|
package/dist/build/docker.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { GitlabJobDef, Context } from "../types";
|
|
1
|
+
import { GitlabJobDef, Context, GitlabJob } from "../types";
|
|
2
2
|
export declare const DOCKER_BUILD_JOB_NAME = "\uD83D\uDD28 docker";
|
|
3
3
|
export declare const createDockerBuildJob: (context: Context, {
|
|
4
|
-
script
|
|
5
|
-
|
|
4
|
+
script,
|
|
5
|
+
variables,
|
|
6
|
+
...def
|
|
7
|
+
}: Partial<GitlabJobDef>) => GitlabJob;
|
package/dist/build/docker.js
CHANGED
|
@@ -14,6 +14,17 @@ var __assign = this && this.__assign || function () {
|
|
|
14
14
|
return __assign.apply(this, arguments);
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
+
var __rest = this && this.__rest || function (s, e) {
|
|
18
|
+
var t = {};
|
|
19
|
+
|
|
20
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
21
|
+
|
|
22
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
23
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
24
|
+
}
|
|
25
|
+
return t;
|
|
26
|
+
};
|
|
27
|
+
|
|
17
28
|
var __read = this && this.__read || function (o, n) {
|
|
18
29
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
19
30
|
if (!m) return o;
|
|
@@ -54,6 +65,8 @@ exports.createDockerBuildJob = exports.DOCKER_BUILD_JOB_NAME = void 0;
|
|
|
54
65
|
|
|
55
66
|
var runner_1 = require("../runner");
|
|
56
67
|
|
|
68
|
+
var lodash_1 = require("lodash");
|
|
69
|
+
|
|
57
70
|
var DOCKER_RUNNER_BUILD_VARIABLES = {
|
|
58
71
|
KUBERNETES_CPU_REQUEST: "0.5",
|
|
59
72
|
KUBERNETES_CPU_LIMIT: "1",
|
|
@@ -63,35 +76,39 @@ var DOCKER_RUNNER_BUILD_VARIABLES = {
|
|
|
63
76
|
exports.DOCKER_BUILD_JOB_NAME = "🔨 docker";
|
|
64
77
|
|
|
65
78
|
var createDockerBuildJob = function (context, _a) {
|
|
66
|
-
var _b, _c, _d, _e
|
|
67
|
-
|
|
68
|
-
var script = _a.script
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
79
|
+
var _b, _c, _d, _e;
|
|
80
|
+
|
|
81
|
+
var script = _a.script,
|
|
82
|
+
variables = _a.variables,
|
|
83
|
+
def = __rest(_a, ["script", "variables"]);
|
|
84
|
+
|
|
85
|
+
return {
|
|
86
|
+
name: exports.DOCKER_BUILD_JOB_NAME,
|
|
87
|
+
envMode: "jobPerEnv",
|
|
88
|
+
job: (0, lodash_1.merge)({
|
|
89
|
+
stage: "build",
|
|
90
|
+
image: (0, runner_1.getRunnerImage)("docker-build"),
|
|
91
|
+
interruptible: true,
|
|
92
|
+
services: [{
|
|
93
|
+
name: "docker:20-dind",
|
|
94
|
+
command: ["--tls=false"]
|
|
95
|
+
}],
|
|
96
|
+
variables: __assign(__assign(__assign({}, DOCKER_RUNNER_BUILD_VARIABLES), {
|
|
97
|
+
DOCKER_BUILDKIT: "1",
|
|
98
|
+
DOCKERFILE_ADDITIONS: (_c = (_b = context.componentConfig.build.docker) === null || _b === void 0 ? void 0 : _b.additionsBegin) === null || _c === void 0 ? void 0 : _c.join("\n"),
|
|
99
|
+
DOCKERFILE_ADDITIONS_END: (_e = (_d = context.componentConfig.build.docker) === null || _d === void 0 ? void 0 : _d.additionsEnd) === null || _e === void 0 ? void 0 : _e.join("\n"),
|
|
100
|
+
APP_DIR: context.componentConfig.dir,
|
|
101
|
+
DOCKER_HOST: "tcp://0.0.0.0:2375",
|
|
102
|
+
DOCKER_TLS_CERTDIR: "",
|
|
103
|
+
DOCKER_DIR: ".",
|
|
104
|
+
IMAGE_TAG: "$CI_COMMIT_SHA",
|
|
105
|
+
DOCKER_DRIVER: "overlay2",
|
|
106
|
+
IMAGE_NAME: "$CI_REGISTRY_IMAGE/" + context.environment.shortName + "/" + context.componentName,
|
|
107
|
+
CACHE_IMAGE: "$CI_REGISTRY_IMAGE/caches/" + context.componentName
|
|
108
|
+
}), variables !== null && variables !== void 0 ? variables : {}),
|
|
109
|
+
script: __spreadArray(__spreadArray([], __read(script || []), false), ["docker login --username gitlab-ci-token --password $CI_JOB_TOKEN $CI_REGISTRY", "docker build --network host --cache-from $CACHE_IMAGE --tag $IMAGE_NAME:$IMAGE_TAG -f $APP_DIR/Dockerfile . --build-arg BUILDKIT_INLINE_CACHE=1", "docker push $IMAGE_NAME:$IMAGE_TAG", "docker tag $IMAGE_NAME:$IMAGE_TAG $CACHE_IMAGE", "docker push $CACHE_IMAGE"], false)
|
|
110
|
+
}, def)
|
|
91
111
|
};
|
|
92
|
-
return __assign(__assign({}, base), {
|
|
93
|
-
script: __spreadArray(__spreadArray([], __read(script), false), ["docker login --username gitlab-ci-token --password $CI_JOB_TOKEN $CI_REGISTRY", "docker build --network host --cache-from $CACHE_IMAGE --tag $IMAGE_NAME:$IMAGE_TAG -f $APP_DIR/Dockerfile . --build-arg BUILDKIT_INLINE_CACHE=1", "docker push $IMAGE_NAME:$IMAGE_TAG", "docker tag $IMAGE_NAME:$IMAGE_TAG $CACHE_IMAGE", "docker push $CACHE_IMAGE"], false)
|
|
94
|
-
});
|
|
95
112
|
};
|
|
96
113
|
|
|
97
114
|
exports.createDockerBuildJob = createDockerBuildJob;
|
|
@@ -60,6 +60,8 @@ var createBuildJob_1 = require("../base/createBuildJob");
|
|
|
60
60
|
|
|
61
61
|
var docker_1 = require("../docker");
|
|
62
62
|
|
|
63
|
+
var path_1 = require("path");
|
|
64
|
+
|
|
63
65
|
var types_1 = require("../types");
|
|
64
66
|
|
|
65
67
|
var cache_1 = require("./cache");
|
|
@@ -69,7 +71,7 @@ var constants_2 = require("./constants");
|
|
|
69
71
|
var yarn_1 = require("./yarn");
|
|
70
72
|
|
|
71
73
|
var createNodeBuildJobs = function (context) {
|
|
72
|
-
var _a, _b;
|
|
74
|
+
var _a, _b, _c, _d, _e;
|
|
73
75
|
|
|
74
76
|
var buildConfig = context.componentConfig.build;
|
|
75
77
|
|
|
@@ -79,22 +81,33 @@ var createNodeBuildJobs = function (context) {
|
|
|
79
81
|
|
|
80
82
|
var yarnInstall = (0, yarn_1.getYarnInstall)(context);
|
|
81
83
|
var appBuildJob = buildConfig.buildCommand !== null ? (0, createBuildJob_1.createBuildJob)(context, {
|
|
82
|
-
variables: __assign(
|
|
84
|
+
variables: __assign({}, constants_2.NODE_RUNNER_BUILD_VARIABLES),
|
|
83
85
|
cache: __spreadArray(__spreadArray([], __read((0, cache_1.getNodeCache)(context)), false), __read((0, cache_1.getNextCache)(context)), false),
|
|
84
|
-
script: __spreadArray(__spreadArray([], __read(yarnInstall), false), __read((
|
|
86
|
+
script: __spreadArray(__spreadArray([], __read(yarnInstall), false), __read((_a = (0, utils_1.ensureArray)(buildConfig.buildCommand)) !== null && _a !== void 0 ? _a : []), false),
|
|
85
87
|
artifacts: {
|
|
86
|
-
paths: [context.componentConfig.dir
|
|
88
|
+
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((_c = (_b = buildConfig.artifactsPaths) === null || _b === void 0 ? void 0 : _b.map(function (path) {
|
|
89
|
+
return (0, path_1.join)(context.componentConfig.dir, path);
|
|
90
|
+
})) !== null && _c !== void 0 ? _c : []), false)
|
|
87
91
|
}
|
|
88
92
|
}) : null;
|
|
89
|
-
return __spreadArray(__spreadArray([], __read(appBuildJob ? [appBuildJob] : []), false), [{
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
93
|
+
return __spreadArray(__spreadArray([], __read(appBuildJob ? [appBuildJob] : []), false), [(0, docker_1.createDockerBuildJob)(context, {
|
|
94
|
+
script: [buildConfig.type === "node-static" || buildConfig.type === "storybook" ? "ensureNginxDockerfile" : "ensureNodeDockerfile"],
|
|
95
|
+
cache: __spreadArray([], __read((0, cache_1.getYarnCache)(context, "pull")), false),
|
|
96
|
+
variables: {
|
|
97
|
+
// only required for non static
|
|
98
|
+
YARN_INSTALL: (0, yarn_1.getYarnInstallCommand)(context, {
|
|
99
|
+
prodOnly: true
|
|
100
|
+
}),
|
|
101
|
+
YARN_INSTALL_WITHOUT_SCRIPTS: (0, yarn_1.getYarnInstallCommand)(context, {
|
|
102
|
+
prodOnly: true,
|
|
103
|
+
noScripts: true
|
|
104
|
+
}),
|
|
105
|
+
DOCKER_COPY_WORKSPACE_FILES: (_e = (_d = context.packageManagerInfo) === null || _d === void 0 ? void 0 : _d.pathsToCopyInDocker.map(function (dir) {
|
|
106
|
+
return "COPY --chown=node:node ".concat(dir, " /app/").concat(dir);
|
|
107
|
+
})) === null || _e === void 0 ? void 0 : _e.join("\n")
|
|
108
|
+
},
|
|
109
|
+
needs: appBuildJob ? [constants_1.APP_BUILD_JOB_NAME] : []
|
|
110
|
+
})], false);
|
|
98
111
|
};
|
|
99
112
|
|
|
100
113
|
exports.createNodeBuildJobs = createNodeBuildJobs;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { Context } from "../../types/context";
|
|
2
2
|
import { GitlabJobCache } from "../../types/gitlab-types";
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const getYarnCache: (context: Context, policy?: string) => GitlabJobCache[];
|
|
4
|
+
export declare const getNodeModulesCache: (context: Context, policy?: string) => GitlabJobCache[];
|
|
5
|
+
export declare const getNodeCache: (context: Context, policy?: string) => GitlabJobCache[];
|
|
4
6
|
export declare const getNextCache: (context: Context) => GitlabJobCache[];
|
package/dist/build/node/cache.js
CHANGED
|
@@ -36,24 +36,52 @@ var __spreadArray = this && this.__spreadArray || function (to, from, pack) {
|
|
|
36
36
|
};
|
|
37
37
|
|
|
38
38
|
exports.__esModule = true;
|
|
39
|
-
exports.getNextCache = exports.getNodeCache = void 0;
|
|
39
|
+
exports.getNextCache = exports.getNodeCache = exports.getNodeModulesCache = exports.getYarnCache = void 0;
|
|
40
40
|
|
|
41
41
|
var path_1 = require("path");
|
|
42
42
|
|
|
43
|
-
var
|
|
43
|
+
var getYarnCache = function (context, policy) {
|
|
44
|
+
if (policy === void 0) {
|
|
45
|
+
policy = "pull-push";
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return [{
|
|
49
|
+
key: "yarn",
|
|
50
|
+
policy: policy,
|
|
51
|
+
paths: [".yarn"]
|
|
52
|
+
}];
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
exports.getYarnCache = getYarnCache;
|
|
56
|
+
|
|
57
|
+
var getNodeModulesCache = function (context, policy) {
|
|
44
58
|
var _a, _b, _c;
|
|
45
59
|
|
|
46
|
-
|
|
60
|
+
if (policy === void 0) {
|
|
61
|
+
policy = "pull-push";
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
var componentIsInWorkspace = (_a = context.packageManagerInfo) === null || _a === void 0 ? void 0 : _a.componentIsInWorkspace;
|
|
47
65
|
return [{
|
|
48
66
|
// if component is in a shared workspace, use workspace cache. use individual cache else
|
|
49
67
|
key: componentIsInWorkspace ? "node-modules-workspace" : context.componentConfig.dir + "-node-modules",
|
|
50
|
-
policy:
|
|
51
|
-
paths: __spreadArray([
|
|
68
|
+
policy: policy,
|
|
69
|
+
paths: __spreadArray([], __read(componentIsInWorkspace ? __spreadArray(["node_modules"], __read((_c = (_b = context.packageManagerInfo) === null || _b === void 0 ? void 0 : _b.workspaces.map(function (w) {
|
|
52
70
|
return (0, path_1.join)(w.location, "node_modules");
|
|
53
71
|
})) !== null && _c !== void 0 ? _c : []), false) : [(0, path_1.join)(context.componentConfig.dir, "node_modules")]), false)
|
|
54
72
|
}];
|
|
55
73
|
};
|
|
56
74
|
|
|
75
|
+
exports.getNodeModulesCache = getNodeModulesCache;
|
|
76
|
+
|
|
77
|
+
var getNodeCache = function (context, policy) {
|
|
78
|
+
if (policy === void 0) {
|
|
79
|
+
policy = "pull-push";
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return __spreadArray(__spreadArray([], __read((0, exports.getYarnCache)(context, policy)), false), __read((0, exports.getNodeModulesCache)(context, policy)), false);
|
|
83
|
+
};
|
|
84
|
+
|
|
57
85
|
exports.getNodeCache = getNodeCache;
|
|
58
86
|
|
|
59
87
|
var getNextCache = function (context) {
|
|
@@ -1,19 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var __assign = this && this.__assign || function () {
|
|
4
|
-
__assign = Object.assign || function (t) {
|
|
5
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
6
|
-
s = arguments[i];
|
|
7
|
-
|
|
8
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
return __assign.apply(this, arguments);
|
|
15
|
-
};
|
|
16
|
-
|
|
17
3
|
var __read = this && this.__read || function (o, n) {
|
|
18
4
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
19
5
|
if (!m) return o;
|
|
@@ -92,15 +78,10 @@ var createMeteorBuildJobs = function (context) {
|
|
|
92
78
|
paths: [context.componentConfig.dir + "/__build_info.json", context.componentConfig.dir + "/dist"]
|
|
93
79
|
}
|
|
94
80
|
}) : null;
|
|
95
|
-
return __spreadArray(__spreadArray([], __read(appBuildJob ? [appBuildJob] : []), false), [{
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
script: ["ensureMeteorDockerfile"]
|
|
100
|
-
})), {
|
|
101
|
-
needs: appBuildJob ? [constants_1.APP_BUILD_JOB_NAME] : []
|
|
102
|
-
})
|
|
103
|
-
}], false);
|
|
81
|
+
return __spreadArray(__spreadArray([], __read(appBuildJob ? [appBuildJob] : []), false), [(0, docker_1.createDockerBuildJob)(context, {
|
|
82
|
+
script: ["ensureMeteorDockerfile"],
|
|
83
|
+
needs: appBuildJob ? [constants_1.APP_BUILD_JOB_NAME] : []
|
|
84
|
+
})], false);
|
|
104
85
|
};
|
|
105
86
|
|
|
106
87
|
exports.createMeteorBuildJobs = createMeteorBuildJobs;
|
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
import { Context } from "../../types";
|
|
2
|
+
export declare const getYarnInstallCommand: (context: Context, options?: {
|
|
3
|
+
prodOnly?: boolean | undefined;
|
|
4
|
+
noScripts?: boolean | undefined;
|
|
5
|
+
} | undefined) => string;
|
|
2
6
|
export declare const getYarnInstall: (context: Context) => string[];
|
package/dist/build/node/yarn.js
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.getYarnInstall = void 0;
|
|
4
|
+
exports.getYarnInstall = exports.getYarnInstallCommand = void 0;
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var getYarnInstallCommand = function (context, options) {
|
|
7
7
|
var _a;
|
|
8
8
|
|
|
9
|
-
return
|
|
9
|
+
return ((_a = context.packageManagerInfo) === null || _a === void 0 ? void 0 : _a.isClassic) ? "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" : "") : (options === null || options === void 0 ? void 0 : options.prodOnly) ? "".concat((options === null || options === void 0 ? void 0 : options.noScripts) ? "YARN_ENABLE_SCRIPTS=false " : "", "yarn plugin import workspace-tools && yarn workspaces focus --production") // needs yarn plugin import workspace-tools
|
|
10
|
+
: "".concat((options === null || options === void 0 ? void 0 : options.noScripts) ? "YARN_ENABLE_SCRIPTS=false " : "", "yarn install --immutable");
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
exports.getYarnInstallCommand = getYarnInstallCommand;
|
|
14
|
+
|
|
15
|
+
var getYarnInstall = function (context) {
|
|
16
|
+
return ["if [ -f ./.nvmrc ]; then source /root/.nvm/nvm.sh && nvm install <<< .nvmrc; fi", (0, exports.getYarnInstallCommand)(context)];
|
|
10
17
|
};
|
|
11
18
|
|
|
12
19
|
exports.getYarnInstall = getYarnInstall;
|
package/dist/build/types.d.ts
CHANGED
|
@@ -42,6 +42,12 @@ export declare type BuildConfigBase = {
|
|
|
42
42
|
audit?: false | {
|
|
43
43
|
command?: string | string[];
|
|
44
44
|
};
|
|
45
|
+
/**
|
|
46
|
+
* additional paths for artifacts,
|
|
47
|
+
* by default "dist" and ".next" are allways included
|
|
48
|
+
*/
|
|
49
|
+
|
|
50
|
+
artifactsPaths?: [];
|
|
45
51
|
};
|
|
46
52
|
export declare type BuildConfigNodeBase = BuildConfigBase;
|
|
47
53
|
export declare type BuildConfigNode = {
|
package/dist/constants.js
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.DOCKER_REGISTRY = exports.PIPELINE_IMAGE_TAG = void 0;
|
|
5
|
-
exports.PIPELINE_IMAGE_TAG = "v1-
|
|
5
|
+
exports.PIPELINE_IMAGE_TAG = "v1-12-0-eb5ba084" || "";
|
|
6
6
|
exports.DOCKER_REGISTRY = "git.panter.ch:5001/catladder/catladder" || "";
|
package/dist/context/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Config } from "../types/config";
|
|
2
|
-
import { CommitInfo, Context, Environment
|
|
2
|
+
import { CommitInfo, Context, Environment } from "../types/context";
|
|
3
3
|
export declare const getSecretVarName: (env: string, componentName: string, key: string) => string;
|
|
4
4
|
export declare const getSecretVarNameForContext: (context: Context, key: string) => string;
|
|
5
5
|
export declare const getEnvironment: (config: Config, componentName: string, env: string, commitInfo?: CommitInfo | undefined, skipReferences?: boolean) => Environment;
|
|
6
|
-
export declare const createContext: (config: Config, componentName: string, env: string, commitInfo?: CommitInfo | undefined,
|
|
6
|
+
export declare const createContext: (config: Config, componentName: string, env: string, commitInfo?: CommitInfo | undefined, packageManagerInfo?: import("../types/context").YarnPackageManagerInfo | undefined) => Context;
|
package/dist/context/index.js
CHANGED
|
@@ -183,7 +183,7 @@ var getEnvironment = function (config, componentName, env, commitInfo, skipRefer
|
|
|
183
183
|
|
|
184
184
|
exports.getEnvironment = getEnvironment;
|
|
185
185
|
|
|
186
|
-
var createContext = function (config, componentName, env, commitInfo,
|
|
186
|
+
var createContext = function (config, componentName, env, commitInfo, packageManagerInfo) {
|
|
187
187
|
var _a, _b;
|
|
188
188
|
|
|
189
189
|
if (!/^[a-z0-9-]+$/.test(componentName)) {
|
|
@@ -214,7 +214,7 @@ var createContext = function (config, componentName, env, commitInfo, yarnInfo)
|
|
|
214
214
|
componentName: componentName,
|
|
215
215
|
environment: (0, exports.getEnvironment)(config, componentName, env, commitInfo),
|
|
216
216
|
commitInfo: commitInfo,
|
|
217
|
-
|
|
217
|
+
packageManagerInfo: packageManagerInfo
|
|
218
218
|
};
|
|
219
219
|
};
|
|
220
220
|
|
|
@@ -205,7 +205,7 @@ var deploy_1 = require("../deploy");
|
|
|
205
205
|
|
|
206
206
|
var utils_1 = require("../utils");
|
|
207
207
|
|
|
208
|
-
var
|
|
208
|
+
var packageManager_1 = require("./packageManager");
|
|
209
209
|
|
|
210
210
|
var createRawJobs = function (context) {
|
|
211
211
|
if (context.componentConfig.deploy === false) {
|
|
@@ -296,7 +296,7 @@ var addStageNeeds = function (jobs) {
|
|
|
296
296
|
|
|
297
297
|
var createJobs = function (envs, config, componentName, trigger) {
|
|
298
298
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
299
|
-
var commitInfo,
|
|
299
|
+
var commitInfo, packageManagerInfo;
|
|
300
300
|
|
|
301
301
|
var _a;
|
|
302
302
|
|
|
@@ -320,14 +320,14 @@ var createJobs = function (envs, config, componentName, trigger) {
|
|
|
320
320
|
commitInfo = (_a.buildId = _d.sent(), _a.trigger = trigger, _a);
|
|
321
321
|
return [4
|
|
322
322
|
/*yield*/
|
|
323
|
-
, (0,
|
|
323
|
+
, (0, packageManager_1.getPackageManagerInfo)(config, componentName)];
|
|
324
324
|
|
|
325
325
|
case 2:
|
|
326
|
-
|
|
326
|
+
packageManagerInfo = _d.sent();
|
|
327
327
|
return [2
|
|
328
328
|
/*return*/
|
|
329
329
|
, envs.reduce(function (acc, env) {
|
|
330
|
-
var context = (0, context_1.createContext)(config, componentName, env, commitInfo,
|
|
330
|
+
var context = (0, context_1.createContext)(config, componentName, env, commitInfo, packageManagerInfo);
|
|
331
331
|
var jobs = addStageNeeds(createRawJobs(context));
|
|
332
332
|
return __assign(__assign({}, acc), jobs.reduce(function (acc, job) {
|
|
333
333
|
var _a;
|
|
@@ -183,7 +183,7 @@ var __importDefault = this && this.__importDefault || function (mod) {
|
|
|
183
183
|
};
|
|
184
184
|
|
|
185
185
|
exports.__esModule = true;
|
|
186
|
-
exports.
|
|
186
|
+
exports.getPackageManagerInfo = void 0;
|
|
187
187
|
|
|
188
188
|
var child_process_promise_1 = require("child-process-promise");
|
|
189
189
|
|
|
@@ -278,7 +278,7 @@ var getWorkspaces = (0, memoizee_1["default"])(function (isClassic) {
|
|
|
278
278
|
_k = "[".concat;
|
|
279
279
|
return [4
|
|
280
280
|
/*yield*/
|
|
281
|
-
, execOrFail("yarn workspaces list --json", "")];
|
|
281
|
+
, execOrFail("yarn workspaces list --json --verbose", "")];
|
|
282
282
|
|
|
283
283
|
case 3:
|
|
284
284
|
_a = _j.apply(_h, [_k.apply("[", [_o.sent().trim().split("\n").join(","), "]"])]);
|
|
@@ -295,9 +295,9 @@ var getWorkspaces = (0, memoizee_1["default"])(function (isClassic) {
|
|
|
295
295
|
promise: true
|
|
296
296
|
});
|
|
297
297
|
|
|
298
|
-
var
|
|
298
|
+
var getPackageManagerInfo = function (config, componentName) {
|
|
299
299
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
300
|
-
var version, isClassic, component, workspaces, componentIsInWorkspace, packageJson, lockFile,
|
|
300
|
+
var version, isClassic, component, workspaces, currentWorkspace, componentIsInWorkspace, workspaceRoot, packageJson, workspacePackageJson, lockFile, configFiles, rcFiles, workspaceDependencies, pathsToCopyInDocker;
|
|
301
301
|
return __generator(this, function (_a) {
|
|
302
302
|
switch (_a.label) {
|
|
303
303
|
case 0:
|
|
@@ -316,30 +316,42 @@ var getYarnInfo = function (config, componentName) {
|
|
|
316
316
|
|
|
317
317
|
case 2:
|
|
318
318
|
workspaces = _a.sent();
|
|
319
|
-
|
|
319
|
+
currentWorkspace = workspaces.find(function (w) {
|
|
320
320
|
return (0, path_equal_1.pathEqual)(component.dir, w.location);
|
|
321
321
|
});
|
|
322
|
+
componentIsInWorkspace = Boolean(currentWorkspace);
|
|
323
|
+
workspaceRoot = ".";
|
|
322
324
|
packageJson = (0, path_1.join)(component.dir, "package.json");
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
325
|
+
workspacePackageJson = componentIsInWorkspace ? (0, path_1.join)(workspaceRoot, "package.json") : null;
|
|
326
|
+
lockFile = componentIsInWorkspace ? (0, path_1.join)(workspaceRoot, "yarn.lock") : (0, path_1.join)(component.dir, "yarn.lock");
|
|
327
|
+
configFiles = [".yarnrc", ".yarnrc.yml", ".npmrc", ".yarn"];
|
|
328
|
+
rcFiles = (componentIsInWorkspace ? configFiles : configFiles.map(function (f) {
|
|
326
329
|
return (0, path_1.join)(component.dir, f);
|
|
327
|
-
})
|
|
328
|
-
files = __spreadArray([packageJson, lockFile], __read(possibleRcFiles), false).filter(function (f) {
|
|
330
|
+
})).filter(function (f) {
|
|
329
331
|
return (0, fs_1.existsSync)(f);
|
|
330
332
|
});
|
|
333
|
+
workspaceDependencies = currentWorkspace ? __spreadArray(__spreadArray([], __read(currentWorkspace.workspaceDependencies), false), __read(currentWorkspace.mismatchedWorkspaceDependencies), false).map(function (name) {
|
|
334
|
+
var _a;
|
|
335
|
+
|
|
336
|
+
return (_a = workspaces.find(function (w) {
|
|
337
|
+
return w.name === name;
|
|
338
|
+
})) === null || _a === void 0 ? void 0 : _a.location;
|
|
339
|
+
}).filter(Boolean) : [];
|
|
340
|
+
pathsToCopyInDocker = __spreadArray(__spreadArray(__spreadArray(__spreadArray([packageJson], __read(workspacePackageJson ? [workspacePackageJson] : []), false), [lockFile], false), __read(rcFiles), false), __read(workspaceDependencies), false);
|
|
331
341
|
return [2
|
|
332
342
|
/*return*/
|
|
333
343
|
, {
|
|
344
|
+
type: "yarn",
|
|
334
345
|
workspaces: workspaces,
|
|
335
346
|
version: version,
|
|
336
347
|
isClassic: isClassic,
|
|
348
|
+
currentWorkspace: currentWorkspace,
|
|
337
349
|
componentIsInWorkspace: componentIsInWorkspace,
|
|
338
|
-
|
|
350
|
+
pathsToCopyInDocker: pathsToCopyInDocker
|
|
339
351
|
}];
|
|
340
352
|
}
|
|
341
353
|
});
|
|
342
354
|
});
|
|
343
355
|
};
|
|
344
356
|
|
|
345
|
-
exports.
|
|
357
|
+
exports.getPackageManagerInfo = getPackageManagerInfo;
|