@catladder/cli 0.0.0-next-d71e41ba → 0.0.0-next-dccc0a36
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/apps/cli/src/scripts/generateCliSkillReference.js +3 -2
- package/dist/apps/cli/src/scripts/generateCliSkillReference.js.map +1 -1
- package/dist/bundles/catenv/index.js +790 -272
- package/dist/bundles/cli/index.js +790 -272
- package/dist/bundles/runner-images/docker-build/scripts/ensureNodeDockerfile +8 -1
- package/dist/bundles/runner-images/jobs-default/Dockerfile +4 -0
- package/dist/bundles/skills/catladder-builds/SKILL.md +68 -5
- package/dist/bundles/skills/catladder-builds/references/build-types.md +8 -6
- package/dist/bundles/skills/catladder-cli/references/commands.md +3 -2
- package/dist/bundles/skills/catladder-config/SKILL.md +5 -0
- package/dist/bundles/skills/catladder-deploys/SKILL.md +1 -1
- package/dist/bundles/skills/catladder-deploys/references/deploy-types.md +2 -2
- package/dist/bundles/skills/catladder-pipelines/SKILL.md +16 -4
- package/dist/packages/pipeline/src/backends/github/GithubBackend.js +4 -4
- package/dist/packages/pipeline/src/backends/github/GithubBackend.js.map +1 -1
- package/dist/packages/pipeline/src/backends/gitlab/GitlabBackend.js +4 -4
- package/dist/packages/pipeline/src/backends/gitlab/GitlabBackend.js.map +1 -1
- package/dist/packages/pipeline/src/build/base/createAppBuildJob.js +2 -2
- package/dist/packages/pipeline/src/build/base/createAppBuildJob.js.map +1 -1
- package/dist/packages/pipeline/src/build/index.d.ts +3 -3
- package/dist/packages/pipeline/src/build/index.js +16 -11
- package/dist/packages/pipeline/src/build/index.js.map +1 -1
- package/dist/packages/pipeline/src/build/node/buildJob.js +49 -8
- package/dist/packages/pipeline/src/build/node/buildJob.js.map +1 -1
- package/dist/packages/pipeline/src/build/node/cache.d.ts +5 -0
- package/dist/packages/pipeline/src/build/node/cache.js +58 -19
- package/dist/packages/pipeline/src/build/node/cache.js.map +1 -1
- package/dist/packages/pipeline/src/build/node/meteor.js +9 -4
- package/dist/packages/pipeline/src/build/node/meteor.js.map +1 -1
- package/dist/packages/pipeline/src/build/node/packageManagerInstall.d.ts +14 -0
- package/dist/packages/pipeline/src/build/node/packageManagerInstall.js +145 -0
- package/dist/packages/pipeline/src/build/node/packageManagerInstall.js.map +1 -0
- package/dist/packages/pipeline/src/build/node/testJob.js +9 -11
- package/dist/packages/pipeline/src/build/node/testJob.js.map +1 -1
- package/dist/packages/pipeline/src/build/types.d.ts +6 -5
- package/dist/packages/pipeline/src/build/types.js.map +1 -1
- package/dist/packages/pipeline/src/context/createComponentContext.js +3 -2
- package/dist/packages/pipeline/src/context/createComponentContext.js.map +1 -1
- package/dist/packages/pipeline/src/context/createWorkspaceContext.js +3 -2
- package/dist/packages/pipeline/src/context/createWorkspaceContext.js.map +1 -1
- package/dist/packages/pipeline/src/customImages/hash.d.ts +9 -0
- package/dist/packages/pipeline/src/customImages/hash.js +41 -16
- package/dist/packages/pipeline/src/customImages/hash.js.map +1 -1
- package/dist/packages/pipeline/src/customImages/jobImagesPlan.d.ts +23 -5
- package/dist/packages/pipeline/src/customImages/jobImagesPlan.js +177 -43
- package/dist/packages/pipeline/src/customImages/jobImagesPlan.js.map +1 -1
- package/dist/packages/pipeline/src/customImages/projectImages.d.ts +67 -0
- package/dist/packages/pipeline/src/customImages/projectImages.js +9 -0
- package/dist/packages/pipeline/src/customImages/projectImages.js.map +1 -0
- package/dist/packages/pipeline/src/deploy/custom/deployJob.js +7 -6
- package/dist/packages/pipeline/src/deploy/custom/deployJob.js.map +1 -1
- package/dist/packages/pipeline/src/deploy/pages/deployJob.js +6 -4
- package/dist/packages/pipeline/src/deploy/pages/deployJob.js.map +1 -1
- package/dist/packages/pipeline/src/deploy/types/custom.d.ts +9 -3
- package/dist/packages/pipeline/src/deploy/types/index.d.ts +4 -4
- package/dist/packages/pipeline/src/deploy/types/pages.d.ts +9 -3
- package/dist/packages/pipeline/src/index.d.ts +2 -0
- package/dist/packages/pipeline/src/index.js +2 -0
- package/dist/packages/pipeline/src/index.js.map +1 -1
- package/dist/packages/pipeline/src/pipeline/detectPackageManager.d.ts +18 -0
- package/dist/packages/pipeline/src/pipeline/detectPackageManager.js +76 -0
- package/dist/packages/pipeline/src/pipeline/detectPackageManager.js.map +1 -0
- package/dist/packages/pipeline/src/pipeline/packageManager.d.ts +1 -1
- package/dist/packages/pipeline/src/pipeline/packageManager.js +43 -9
- package/dist/packages/pipeline/src/pipeline/packageManager.js.map +1 -1
- package/dist/packages/pipeline/src/pipeline/pnpm/pnpmUtils.d.ts +14 -0
- package/dist/packages/pipeline/src/pipeline/pnpm/pnpmUtils.js +93 -0
- package/dist/packages/pipeline/src/pipeline/pnpm/pnpmUtils.js.map +1 -0
- package/dist/packages/pipeline/src/types/config.d.ts +16 -1
- package/dist/packages/pipeline/src/types/config.js.map +1 -1
- package/dist/packages/pipeline/src/types/context.d.ts +11 -3
- package/dist/packages/pipeline/src/types/context.js.map +1 -1
- package/dist/packages/pipeline/src/types/jobs.d.ts +2 -1
- package/dist/packages/pipeline/src/types/jobs.js.map +1 -1
- package/dist/packages/pipeline/src/verify/createVerifyJobs.js +5 -5
- package/dist/packages/pipeline/src/verify/createVerifyJobs.js.map +1 -1
- package/dist/runner-images/docker-build/scripts/ensureNodeDockerfile +8 -1
- package/dist/runner-images/jobs-default/Dockerfile +4 -0
- package/dist/skills/catladder-builds/SKILL.md +68 -5
- package/dist/skills/catladder-builds/references/build-types.md +8 -6
- package/dist/skills/catladder-cli/references/commands.md +3 -2
- package/dist/skills/catladder-config/SKILL.md +5 -0
- package/dist/skills/catladder-deploys/SKILL.md +1 -1
- package/dist/skills/catladder-deploys/references/deploy-types.md +2 -2
- package/dist/skills/catladder-pipelines/SKILL.md +16 -4
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/scripts/generateCliSkillReference.ts +3 -2
- package/dist/packages/pipeline/src/build/node/yarn.d.ts +0 -8
- package/dist/packages/pipeline/src/build/node/yarn.js +0 -78
- package/dist/packages/pipeline/src/build/node/yarn.js.map +0 -1
|
@@ -6,7 +6,7 @@ const base_1 = require("../base");
|
|
|
6
6
|
const createBuildJobDefinition_1 = require("../base/createBuildJobDefinition");
|
|
7
7
|
const docker_1 = require("../docker");
|
|
8
8
|
const cache_1 = require("./cache");
|
|
9
|
-
const
|
|
9
|
+
const packageManagerInstall_1 = require("./packageManagerInstall");
|
|
10
10
|
const createNodeBuildJobs = async (context) => {
|
|
11
11
|
if (context.type === "workspace") {
|
|
12
12
|
return (0, base_1.createWorkspaceBuildJobs)(context, {
|
|
@@ -23,18 +23,17 @@ const createNodeBuildJobs = async (context) => {
|
|
|
23
23
|
exports.createNodeBuildJobs = createNodeBuildJobs;
|
|
24
24
|
const createNodeBuildJobDefinition = async (context) => {
|
|
25
25
|
const buildConfig = context.build.config;
|
|
26
|
-
const [
|
|
27
|
-
(0,
|
|
26
|
+
const [packageManagerInstall, nodeCache] = await Promise.all([
|
|
27
|
+
(0, packageManagerInstall_1.getPackageManagerInstall)(context),
|
|
28
28
|
(0, cache_1.getNodeCache)(context),
|
|
29
29
|
]);
|
|
30
30
|
return (0, createBuildJobDefinition_1.createBuildJobDefinition)(context, buildConfig, {
|
|
31
|
-
prescript:
|
|
31
|
+
prescript: packageManagerInstall,
|
|
32
32
|
cache: nodeCache,
|
|
33
33
|
});
|
|
34
34
|
};
|
|
35
35
|
exports.createNodeBuildJobDefinition = createNodeBuildJobDefinition;
|
|
36
36
|
const createNodeDockerJobDefinition = async (context) => {
|
|
37
|
-
var _a;
|
|
38
37
|
// get the default docker built-in type based on the build type
|
|
39
38
|
const dockerDefaultBuiltIn = context.build.buildType === "node-static" ||
|
|
40
39
|
context.build.buildType === "storybook"
|
|
@@ -42,16 +41,58 @@ const createNodeDockerJobDefinition = async (context) => {
|
|
|
42
41
|
: "node";
|
|
43
42
|
const [yarnCache, dockerAppCopyAndBuildScript, packageManagerInfo] = await Promise.all([
|
|
44
43
|
(0, cache_1.getYarnCache)(context, "pull"),
|
|
45
|
-
(0,
|
|
44
|
+
(0, packageManagerInstall_1.getDockerAppCopyAndBuildScript)(context),
|
|
46
45
|
context.packageManagerInfo,
|
|
47
46
|
]);
|
|
47
|
+
// the pnpm store (pulled via the cache above) is copied into the
|
|
48
|
+
// image so the prod install works offline — like the yarn zip cache,
|
|
49
|
+
// which travels inside the copied `.yarn` config folder
|
|
50
|
+
const copyPnpmStore = packageManagerInfo.type === "pnpm" &&
|
|
51
|
+
packageManagerInfo.componentIsInWorkspace;
|
|
52
|
+
// pnpm copies every workspace manifest into the image — as individual
|
|
53
|
+
// COPY instructions that many layers exceed docker's depth limit, so
|
|
54
|
+
// the job tars them up and a single ADD extracts them
|
|
55
|
+
const isPnpm = packageManagerInfo.type === "pnpm";
|
|
56
|
+
const WORKSPACE_FILES_TAR = ".catladder-workspace-files.tar";
|
|
48
57
|
return {
|
|
49
|
-
script:
|
|
58
|
+
script: [
|
|
59
|
+
// the COPY source must exist even when the cache was cold
|
|
60
|
+
...(copyPnpmStore ? ["mkdir -p .pnpm-store"] : []),
|
|
61
|
+
...(isPnpm
|
|
62
|
+
? [
|
|
63
|
+
`tar -cf ${WORKSPACE_FILES_TAR} ${packageManagerInfo.pathsToCopyInDocker.join(" ")}`,
|
|
64
|
+
]
|
|
65
|
+
: []),
|
|
66
|
+
...(0, docker_1.getDockerBuildScriptWithBuiltInDockerFile)(context, dockerDefaultBuiltIn),
|
|
67
|
+
],
|
|
50
68
|
cache: [...yarnCache],
|
|
51
69
|
variables: {
|
|
52
70
|
// only required for non static
|
|
53
71
|
DOCKER_COPY_AND_INSTALL_APP: dockerAppCopyAndBuildScript,
|
|
54
|
-
DOCKER_COPY_WORKSPACE_FILES:
|
|
72
|
+
DOCKER_COPY_WORKSPACE_FILES: isPnpm
|
|
73
|
+
? [
|
|
74
|
+
`ADD ${WORKSPACE_FILES_TAR} /app/`,
|
|
75
|
+
// ADD does not apply --chown to extracted tars, and parent
|
|
76
|
+
// dirs of the entries come out root-owned — fix ownership
|
|
77
|
+
// while the stage still runs as root (store not copied yet,
|
|
78
|
+
// so this only touches the small manifest tree). Custom
|
|
79
|
+
// base images without a node user run as root and don't
|
|
80
|
+
// need it, hence the fallback
|
|
81
|
+
`RUN chown -R node:node /app || true`,
|
|
82
|
+
...(copyPnpmStore
|
|
83
|
+
? [`COPY --chown=node:node .pnpm-store /app/.pnpm-store`]
|
|
84
|
+
: []),
|
|
85
|
+
].join("\n")
|
|
86
|
+
: packageManagerInfo.pathsToCopyInDocker
|
|
87
|
+
.map((dir) => `COPY --chown=node:node ${dir} /app/${dir}`)
|
|
88
|
+
.join("\n"),
|
|
89
|
+
// pnpm is not preinstalled in the node base images; installed as
|
|
90
|
+
// root before the image switches to the node user
|
|
91
|
+
...(isPnpm
|
|
92
|
+
? {
|
|
93
|
+
DOCKER_SETUP_PACKAGE_MANAGER: `RUN npm install -g pnpm@${packageManagerInfo.version}`,
|
|
94
|
+
}
|
|
95
|
+
: {}),
|
|
55
96
|
},
|
|
56
97
|
};
|
|
57
98
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildJob.js","sourceRoot":"","sources":["../../../../../../../../packages/pipeline/src/build/node/buildJob.ts"],"names":[],"mappings":";;;AAKA,iDAG6B;AAM7B,kCAA6E;AAC7E,+EAA4E;AAC5E,sCAAsE;AAEtE,mCAAqD;AACrD,
|
|
1
|
+
{"version":3,"file":"buildJob.js","sourceRoot":"","sources":["../../../../../../../../packages/pipeline/src/build/node/buildJob.ts"],"names":[],"mappings":";;;AAKA,iDAG6B;AAM7B,kCAA6E;AAC7E,+EAA4E;AAC5E,sCAAsE;AAEtE,mCAAqD;AACrD,mEAGiC;AAE1B,MAAM,mBAAmB,GAAG,KAAK,EACtC,OAAqD,EAC5B,EAAE;IAC3B,IAAI,OAAO,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;QACjC,OAAO,IAAA,+BAAwB,EAAC,OAAO,EAAE;YACvC,QAAQ,EAAE,MAAM,IAA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AG,SAAS,GAAG,EAAE,CAAC;qBACzD,IAAI,CAAC,IAAI,CAAC;YACjB,iEAAiE;YACjE,kDAAkD;YAClD,GAAG,CAAC,MAAM;gBACR,CAAC,CAAC;oBACE,4BAA4B,EAAE,2BAA2B,kBAAkB,CAAC,OAAO,EAAE;iBACtF;gBACH,CAAC,CAAC,EAAE,CAAC;SACR;KACF,CAAC;AACJ,CAAC,CAAC;AA1EW,QAAA,6BAA6B,iCA0ExC"}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import type { Context } from "../../types/context";
|
|
2
2
|
import type { CacheConfig } from "../types";
|
|
3
|
+
/**
|
|
4
|
+
* the package manager's download cache: yarn's `.yarn` zip cache, or
|
|
5
|
+
* pnpm's content-addressable store (which catladder points at a
|
|
6
|
+
* project-local `.pnpm-store`, see the install script)
|
|
7
|
+
*/
|
|
3
8
|
export declare const getYarnCache: (context: Context, policy?: string) => Promise<CacheConfig[]>;
|
|
4
9
|
export declare const getNodeModulesCache: (context: Context, policy?: string) => Promise<CacheConfig[]>;
|
|
5
10
|
export declare const getNodeCache: (context: Context, policy?: string) => Promise<CacheConfig[]>;
|
|
@@ -4,12 +4,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getNodeCache = exports.getNodeModulesCache = exports.getYarnCache = void 0;
|
|
7
|
+
const lodash_es_1 = require("lodash-es");
|
|
7
8
|
const path_1 = require("path");
|
|
8
9
|
const slugify_1 = __importDefault(require("slugify"));
|
|
9
10
|
/**
|
|
10
|
-
* stable reference between the two node caches: the
|
|
11
|
-
* declares itself redundant when the
|
|
12
|
-
* exact-lockfile hit (github skips the
|
|
11
|
+
* stable reference between the two node caches: the package-manager
|
|
12
|
+
* (yarn zip / pnpm store) cache declares itself redundant when the
|
|
13
|
+
* node_modules cache scored an exact-lockfile hit (github skips the
|
|
14
|
+
* ~0.6GB download on warm runs)
|
|
13
15
|
*/
|
|
14
16
|
const NODE_MODULES_CACHE_ID = "node-modules";
|
|
15
17
|
/**
|
|
@@ -36,23 +38,37 @@ const getCacheBaseDir = async (context) => {
|
|
|
36
38
|
? ((_a = context.build.workspaceBuildConfig.dir) !== null && _a !== void 0 ? _a : ".")
|
|
37
39
|
: ".";
|
|
38
40
|
};
|
|
41
|
+
/**
|
|
42
|
+
* the package manager's download cache: yarn's `.yarn` zip cache, or
|
|
43
|
+
* pnpm's content-addressable store (which catladder points at a
|
|
44
|
+
* project-local `.pnpm-store`, see the install script)
|
|
45
|
+
*/
|
|
39
46
|
const getYarnCache = async (context, policy = "pull-push") => {
|
|
47
|
+
const packageManagerInfo = await context.packageManagerInfo;
|
|
48
|
+
const isPnpm = packageManagerInfo.type === "pnpm";
|
|
40
49
|
const baseDir = await getCacheBaseDir(context);
|
|
50
|
+
// pnpm keeps its store in a format-versioned subdir (v10, v11, ...)
|
|
51
|
+
// and never cleans old ones up — scope the cache slot by major so a
|
|
52
|
+
// pnpm upgrade starts a fresh slot instead of dragging the dead old
|
|
53
|
+
// store tree along in every cache transfer (formats change only on
|
|
54
|
+
// majors)
|
|
55
|
+
const pnpmStoreKey = `pnpm-v${packageManagerInfo.version.split(".")[0]}`;
|
|
41
56
|
return [
|
|
42
57
|
{
|
|
43
58
|
scope: "buildDir",
|
|
44
59
|
pathMode: "relative",
|
|
45
60
|
buildDir: baseDir,
|
|
46
|
-
key: "yarn",
|
|
61
|
+
key: isPnpm ? pnpmStoreKey : "yarn",
|
|
47
62
|
policy,
|
|
48
|
-
paths: [".yarn"],
|
|
63
|
+
paths: [isPnpm ? ".pnpm-store" : ".yarn"],
|
|
49
64
|
// content-key for immutable-cache backends (github); the lockfile
|
|
50
65
|
// decides whether the cached content could have changed
|
|
51
|
-
keyFiles: ["yarn.lock"],
|
|
52
|
-
// the
|
|
53
|
-
//
|
|
54
|
-
// same lockfile, install verifies
|
|
55
|
-
//
|
|
66
|
+
keyFiles: [isPnpm ? "pnpm-lock.yaml" : "yarn.lock"],
|
|
67
|
+
// the package manager's download cache (~hundreds of MB) is only
|
|
68
|
+
// read when packages have to be (re)installed. When the
|
|
69
|
+
// node_modules cache hit for the same lockfile, install verifies
|
|
70
|
+
// its state file and never touches the store — so github skips
|
|
71
|
+
// downloading this cache entirely
|
|
56
72
|
redundantOnExactHitOf: NODE_MODULES_CACHE_ID,
|
|
57
73
|
},
|
|
58
74
|
];
|
|
@@ -61,27 +77,50 @@ exports.getYarnCache = getYarnCache;
|
|
|
61
77
|
const getNodeModulesCache = async (context, policy = "pull-push") => {
|
|
62
78
|
const packageManagerInfo = await context.packageManagerInfo;
|
|
63
79
|
const baseDir = await getCacheBaseDir(context);
|
|
64
|
-
const {
|
|
65
|
-
|
|
80
|
+
const { workspaces } = packageManagerInfo;
|
|
81
|
+
const isPnpm = packageManagerInfo.type === "pnpm";
|
|
82
|
+
const lockFileName = isPnpm ? "pnpm-lock.yaml" : "yarn.lock";
|
|
83
|
+
// yarn berry tracks install state in .yarn/install-state.gz (pnpm's
|
|
84
|
+
// equivalent lives inside node_modules and is covered by the paths)
|
|
85
|
+
const hasInstallState = packageManagerInfo.type === "yarn" && !packageManagerInfo.isClassic;
|
|
86
|
+
// We intentionally do not use the contents of the lockfile as a cache key, as install should always guarantee that the files are updated, but it can still use part of the cache if not all packages are up-to-date.
|
|
66
87
|
// It would slow down all pipelines whenever one adds a new dependency as it will need to download all node_modules again.
|
|
67
88
|
return [
|
|
68
89
|
{
|
|
69
90
|
scope: "global",
|
|
70
91
|
pathMode: "absolute",
|
|
71
92
|
// 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
|
|
72
|
-
|
|
93
|
+
//
|
|
94
|
+
// pnpm gets its own, lockfile-keyed cache: node_modules layouts
|
|
95
|
+
// are not compatible between package managers (a migrating
|
|
96
|
+
// project must not inherit the yarn slot), and unlike yarn, a
|
|
97
|
+
// pnpm install on top of a node_modules from a different lockfile
|
|
98
|
+
// leaves orphaned .pnpm dirs behind that break type identity —
|
|
99
|
+
// so the slot changes whenever the lockfile changes
|
|
100
|
+
key: isPnpm
|
|
101
|
+
? {
|
|
102
|
+
prefix: "pnpm-" + (0, slugify_1.default)(baseDir) + "-node-modules",
|
|
103
|
+
files: [(0, path_1.join)(baseDir, "pnpm-lock.yaml")],
|
|
104
|
+
}
|
|
105
|
+
: (0, slugify_1.default)(baseDir) + "-node-modules",
|
|
73
106
|
// content-key for immutable-cache backends (github); the lockfile
|
|
74
107
|
// decides whether the cached content could have changed (absolute
|
|
75
108
|
// pathMode: resolve the lockfile explicitly)
|
|
76
|
-
keyFiles: [(0, path_1.join)(baseDir,
|
|
77
|
-
// referenced by the
|
|
78
|
-
//
|
|
109
|
+
keyFiles: [(0, path_1.join)(baseDir, lockFileName)],
|
|
110
|
+
// referenced by the package-manager cache: an exact hit here makes
|
|
111
|
+
// it unnecessary (see redundantOnExactHitOf on getYarnCache)
|
|
79
112
|
cacheId: NODE_MODULES_CACHE_ID,
|
|
80
113
|
policy,
|
|
81
|
-
paths: [
|
|
114
|
+
paths: (0, lodash_es_1.uniq)([
|
|
82
115
|
(0, path_1.join)(baseDir, "node_modules"),
|
|
83
|
-
|
|
84
|
-
|
|
116
|
+
// pnpm's per-package node_modules are symlink farms worth
|
|
117
|
+
// keeping warm (yarn hoists into the root, so root-only
|
|
118
|
+
// matches its historical behavior)
|
|
119
|
+
...(isPnpm
|
|
120
|
+
? workspaces.map((w) => (0, path_1.join)(w.location, "node_modules"))
|
|
121
|
+
: []),
|
|
122
|
+
...(hasInstallState ? [(0, path_1.join)(baseDir, ".yarn/install-state.gz")] : []),
|
|
123
|
+
]),
|
|
85
124
|
},
|
|
86
125
|
];
|
|
87
126
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache.js","sourceRoot":"","sources":["../../../../../../../../packages/pipeline/src/build/node/cache.ts"],"names":[],"mappings":";;;;;;AAAA,+BAA4B;AAC5B,sDAA8B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IAAA,2BAAmB,EAAC,OAAO,EAAE,MAAM,CAAC,CAAC;KAChD,CAAC;AACJ,CAAC,CAAC;AARW,QAAA,YAAY,gBAQvB"}
|
|
@@ -7,7 +7,7 @@ const base_1 = require("../base");
|
|
|
7
7
|
const docker_1 = require("../docker");
|
|
8
8
|
const types_1 = require("../types");
|
|
9
9
|
const cache_1 = require("./cache");
|
|
10
|
-
const
|
|
10
|
+
const packageManagerInstall_1 = require("./packageManagerInstall");
|
|
11
11
|
const getMeteorCache = (context) => [
|
|
12
12
|
{
|
|
13
13
|
key: "meteor-build-cache",
|
|
@@ -22,6 +22,11 @@ const getMeteorCache = (context) => [
|
|
|
22
22
|
];
|
|
23
23
|
const getMeteorDockerInstallScripts = async (context) => {
|
|
24
24
|
const packageManagerInfo = await context.packageManagerInfo;
|
|
25
|
+
if (packageManagerInfo.type === "pnpm") {
|
|
26
|
+
// not a meteor limitation — catladder's meteor docker install path
|
|
27
|
+
// is only implemented for yarn so far
|
|
28
|
+
throw new Error("the meteor build type is only implemented for yarn in catladder");
|
|
29
|
+
}
|
|
25
30
|
if (packageManagerInfo.isClassic) {
|
|
26
31
|
return new bash_1.BashExpression(`
|
|
27
32
|
COPY $APP_DIR/package.json $APP_DIR/yarn.lock ./
|
|
@@ -48,8 +53,8 @@ const createMeteorBuildJobs = async (context) => {
|
|
|
48
53
|
if (!(0, types_1.isOfBuildType)(buildConfig, "meteor")) {
|
|
49
54
|
throw new Error("deploy config is not meteor");
|
|
50
55
|
}
|
|
51
|
-
const [
|
|
52
|
-
(0,
|
|
56
|
+
const [packageManagerInstall, nodeCache, meteorInstallScripts] = await Promise.all([
|
|
57
|
+
(0, packageManagerInstall_1.getPackageManagerInstall)(context),
|
|
53
58
|
(0, cache_1.getNodeCache)(context),
|
|
54
59
|
buildConfig.installScripts
|
|
55
60
|
? getMeteorDockerInstallScripts(context)
|
|
@@ -64,7 +69,7 @@ const createMeteorBuildJobs = async (context) => {
|
|
|
64
69
|
METEOR_DISABLE_OPTIMISTIC_CACHING: "1", // see https://forums.meteor.com/t/veeery-long-building-time-inside-docker-container/58673/17?u=macrozone
|
|
65
70
|
},
|
|
66
71
|
script: [
|
|
67
|
-
...
|
|
72
|
+
...packageManagerInstall,
|
|
68
73
|
'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',
|
|
69
74
|
"cp ./__build_info.json ./dist/bundle/programs/server",
|
|
70
75
|
],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meteor.js","sourceRoot":"","sources":["../../../../../../../../packages/pipeline/src/build/node/meteor.ts"],"names":[],"mappings":";;;AAAA,0CAAiD;AACjD,yCAA8C;AAQ9C,kCAAmD;AACnD,sCAAsE;AAEtE,oCAAyC;AACzC,mCAAuC;AACvC,
|
|
1
|
+
{"version":3,"file":"meteor.js","sourceRoot":"","sources":["../../../../../../../../packages/pipeline/src/build/node/meteor.ts"],"names":[],"mappings":";;;AAAA,0CAAiD;AACjD,yCAA8C;AAQ9C,kCAAmD;AACnD,sCAAsE;AAEtE,oCAAyC;AACzC,mCAAuC;AACvC,mEAAmE;AAEnE,MAAM,cAAc,GAAG,CAAC,OAAyB,EAAiB,EAAE,CAAC;IACnE;QACE,GAAG,EAAE,oBAAoB;QACzB,MAAM,EAAE,WAAW;QACnB,KAAK,EAAE;YACL,0CAA0C;YAC1C,4BAA4B;YAC5B,wBAAwB;YACxB,qCAAqC;SACtC;KACF;CACF,CAAC;AACF,MAAM,6BAA6B,GAAG,KAAK,EACzC,OAAkC,EACT,EAAE;IAC3B,MAAM,kBAAkB,GAAG,MAAM,OAAO,CAAC,kBAAkB,CAAC;IAC5D,IAAI,kBAAkB,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;QACvC,mEAAmE;QACnE,sCAAsC;QACtC,MAAM,IAAI,KAAK,CACb,iEAAiE,CAClE,CAAC;IACJ,CAAC;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EAAE,CAAC,GAAG,SAAS,EAAE,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;gBACjD,KAAK,EAAE,IAAA,uBAAc,EAAC,aAAa,CAAC;gBACpC,SAAS,EAAE;oBACT,iCAAiC,EAAE,GAAG,EAAE,yGAAyG;iBAClJ;gBACD,MAAM,EAAE;oBACN,GAAG,qBAAqB;oBAExB,kNAAkN;oBAElN,sDAAsD;iBACvD;aACF;YACH,CAAC,CAAC,SAAS;QACf,WAAW,EAAE;YACX,MAAM,EAAE,IAAA,kDAAyC,EAAC,OAAO,EAAE,QAAQ,CAAC;YACpE,SAAS,EAAE;gBACT,sBAAsB,EAAE,oBAAoB;aAC7C;SACF;KACF,CAAC,CAAC;AACL,CAAC,CAAC;AA3CW,QAAA,qBAAqB,yBA2ChC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BashExpression } from "../../../../bash/src/index.js";
|
|
2
|
+
import type { ComponentContextWithBuild, PackageManagerInfoBase } from "../../types";
|
|
3
|
+
import { type Context } from "../../types";
|
|
4
|
+
/**
|
|
5
|
+
* default `audit` job command per package manager. Exhaustive on the
|
|
6
|
+
* package-manager type and throws for anything unsupported, so adding a
|
|
7
|
+
* new package manager surfaces every place that needs a command here.
|
|
8
|
+
*/
|
|
9
|
+
export declare const getDefaultAuditCommand: (packageManagerInfo: PackageManagerInfoBase) => string;
|
|
10
|
+
export declare const ensureNodeVersion: (context: Context) => string[];
|
|
11
|
+
export declare const getPackageManagerInstall: (context: Context, options?: {
|
|
12
|
+
noCustomPostInstall: boolean;
|
|
13
|
+
}) => Promise<string[]>;
|
|
14
|
+
export declare const getDockerAppCopyAndBuildScript: (context: ComponentContextWithBuild) => Promise<BashExpression>;
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getDockerAppCopyAndBuildScript = exports.getPackageManagerInstall = exports.ensureNodeVersion = exports.getDefaultAuditCommand = void 0;
|
|
4
|
+
const bash_1 = require("../../../../bash/src/index.js");
|
|
5
|
+
const utils_1 = require("../../utils");
|
|
6
|
+
const gitlab_1 = require("../../utils/gitlab");
|
|
7
|
+
const YARN_INSTALL_CLASSIC = `yarn install --frozen-lockfile`;
|
|
8
|
+
const YARN_BERRY_PROD_INSTALL = `yarn workspaces focus --production`;
|
|
9
|
+
// FIXME: check why and when rebuild is needed
|
|
10
|
+
const YARN_BERRY_PROD_REBUILD = `yarn rebuild`;
|
|
11
|
+
const getYarnInstallCommand = (packageManagerInfo) => {
|
|
12
|
+
if (packageManagerInfo.isClassic) {
|
|
13
|
+
return YARN_INSTALL_CLASSIC;
|
|
14
|
+
}
|
|
15
|
+
// inline builds make debugging easier as it prints it out in the logs, instead of writing it in temp files
|
|
16
|
+
return `yarn install --immutable --inline-builds`;
|
|
17
|
+
};
|
|
18
|
+
const isInWorkspace = (context, packageManagerInfo) => context.type === "workspace" ||
|
|
19
|
+
("componentIsInWorkspace" in packageManagerInfo &&
|
|
20
|
+
packageManagerInfo.componentIsInWorkspace);
|
|
21
|
+
/**
|
|
22
|
+
* make sure pnpm is available (job images ship it, older/custom images
|
|
23
|
+
* fall back to corepack or a pinned global install)
|
|
24
|
+
*/
|
|
25
|
+
const getEnsurePnpmCommand = (version) => `if ! command -v pnpm &> /dev/null; then corepack enable pnpm 2>/dev/null || npm install -g pnpm@${version}; fi`;
|
|
26
|
+
/**
|
|
27
|
+
* pnpm's store is global by default; point it at a project-local
|
|
28
|
+
* directory so CI can cache it (the pnpm equivalent of the `.yarn`
|
|
29
|
+
* zip cache). Passed as the --store-dir flag: pnpm 11 stopped reading
|
|
30
|
+
* the npm_config_store_dir env var (settings only come from
|
|
31
|
+
* pnpm-workspace.yaml / global config / CLI flags), the flag works on
|
|
32
|
+
* v10 and v11
|
|
33
|
+
*/
|
|
34
|
+
const getPnpmStoreDirExpression = (inWorkspace) => inWorkspace
|
|
35
|
+
? `"$(git rev-parse --show-toplevel 2>/dev/null || pwd)/.pnpm-store"`
|
|
36
|
+
: `"$PWD/.pnpm-store"`;
|
|
37
|
+
const getPnpmInstallCommands = (context, packageManagerInfo) => [
|
|
38
|
+
getEnsurePnpmCommand(packageManagerInfo.version),
|
|
39
|
+
`pnpm install --frozen-lockfile --store-dir ${getPnpmStoreDirExpression(isInWorkspace(context, packageManagerInfo))}`,
|
|
40
|
+
];
|
|
41
|
+
/**
|
|
42
|
+
* default `audit` job command per package manager. Exhaustive on the
|
|
43
|
+
* package-manager type and throws for anything unsupported, so adding a
|
|
44
|
+
* new package manager surfaces every place that needs a command here.
|
|
45
|
+
*/
|
|
46
|
+
const getDefaultAuditCommand = (packageManagerInfo) => {
|
|
47
|
+
switch (packageManagerInfo.type) {
|
|
48
|
+
case "pnpm":
|
|
49
|
+
return "pnpm audit --prod --audit-level critical";
|
|
50
|
+
case "yarn":
|
|
51
|
+
return packageManagerInfo.isClassic
|
|
52
|
+
? "yarn audit --level critical"
|
|
53
|
+
: "yarn npm audit --environment production --severity critical"; // yarn 2+
|
|
54
|
+
default:
|
|
55
|
+
throw new Error(`no audit command implemented for package manager "${packageManagerInfo.type}"`);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
exports.getDefaultAuditCommand = getDefaultAuditCommand;
|
|
59
|
+
const ensureNodeVersion = (context) => (0, gitlab_1.collapseableSection)("nodeinstall", "Ensure node version")([
|
|
60
|
+
// github actions overrides HOME in container jobs, so also look
|
|
61
|
+
// for nvm where the catladder images install it (/root/.nvm)
|
|
62
|
+
'if [ -f "$HOME/.nvm/nvm.sh" ]; then source "$HOME/.nvm/nvm.sh"; elif [ -f /root/.nvm/nvm.sh ]; then export NVM_DIR=/root/.nvm; source /root/.nvm/nvm.sh; fi',
|
|
63
|
+
"if command -v nvm &> /dev/null && [ -f ./.nvmrc ]; then nvm install; fi",
|
|
64
|
+
]);
|
|
65
|
+
exports.ensureNodeVersion = ensureNodeVersion;
|
|
66
|
+
const getPackageManagerInstall = async (context, options) => {
|
|
67
|
+
const packageManagerInfo = await context.packageManagerInfo;
|
|
68
|
+
const postInstall = context.type !== "workspace" &&
|
|
69
|
+
context.build.type !== "disabled" &&
|
|
70
|
+
"postInstall" in context.build.config
|
|
71
|
+
? context.build.config.postInstall
|
|
72
|
+
: null;
|
|
73
|
+
const installSection = packageManagerInfo.type === "pnpm"
|
|
74
|
+
? (0, gitlab_1.collapseableSection)("pnpminstall", "pnpm install")(getPnpmInstallCommands(context, packageManagerInfo))
|
|
75
|
+
: (0, gitlab_1.collapseableSection)("yarninstall", "Yarn install")([getYarnInstallCommand(packageManagerInfo)]);
|
|
76
|
+
return [
|
|
77
|
+
...(0, exports.ensureNodeVersion)(context),
|
|
78
|
+
...installSection,
|
|
79
|
+
...(postInstall && !(options === null || options === void 0 ? void 0 : options.noCustomPostInstall)
|
|
80
|
+
? (0, gitlab_1.collapseableSection)("postinstall", "Custom post install")((0, utils_1.ensureArray)(postInstall))
|
|
81
|
+
: []),
|
|
82
|
+
];
|
|
83
|
+
};
|
|
84
|
+
exports.getPackageManagerInstall = getPackageManagerInstall;
|
|
85
|
+
const DOCKER_COPY_FILES = `COPY --chown=node:node $APP_DIR .`;
|
|
86
|
+
const getPnpmDockerAppCopyAndBuildScript = (packageManagerInfo) => {
|
|
87
|
+
// the store was copied into the image (like the yarn zip cache), so
|
|
88
|
+
// the prod install links from it instead of hitting the registry
|
|
89
|
+
const storeDir = packageManagerInfo.componentIsInWorkspace
|
|
90
|
+
? "/app/.pnpm-store"
|
|
91
|
+
: "/app/$APP_DIR/.pnpm-store";
|
|
92
|
+
// in a workspace, only install the component (and its workspace
|
|
93
|
+
// dependencies) — the pnpm equivalent of `yarn workspaces focus`.
|
|
94
|
+
// npm package names are shell-safe unquoted (the whole script is
|
|
95
|
+
// embedded in a double-quoted bash export, so inner quotes would nest)
|
|
96
|
+
const filter = packageManagerInfo.componentIsInWorkspace &&
|
|
97
|
+
packageManagerInfo.currentWorkspace
|
|
98
|
+
? ` --filter ${packageManagerInfo.currentWorkspace.name}...`
|
|
99
|
+
: "";
|
|
100
|
+
return new bash_1.BashExpression(`
|
|
101
|
+
${DOCKER_COPY_FILES}
|
|
102
|
+
RUN command -v pnpm >/dev/null 2>&1 || npm install -g pnpm@${packageManagerInfo.version}
|
|
103
|
+
RUN pnpm install --prod --frozen-lockfile --store-dir ${storeDir}${filter}
|
|
104
|
+
`.trim());
|
|
105
|
+
};
|
|
106
|
+
const getDockerAppCopyAndBuildScript = async (context) => {
|
|
107
|
+
var _a, _b, _c;
|
|
108
|
+
const packageManagerInfo = await context.packageManagerInfo;
|
|
109
|
+
if (packageManagerInfo.type === "pnpm") {
|
|
110
|
+
return getPnpmDockerAppCopyAndBuildScript(packageManagerInfo);
|
|
111
|
+
}
|
|
112
|
+
if (packageManagerInfo.isClassic) {
|
|
113
|
+
return new bash_1.BashExpression(`
|
|
114
|
+
RUN ${YARN_INSTALL_CLASSIC} --production --ignore-scripts
|
|
115
|
+
${DOCKER_COPY_FILES}
|
|
116
|
+
RUN ${YARN_INSTALL_CLASSIC} --production
|
|
117
|
+
`.trim());
|
|
118
|
+
}
|
|
119
|
+
const yarnRebuildEnabledDefault = context.build.type === "fromWorkspace"
|
|
120
|
+
? ((_b = (_a = context.build.workspaceBuildConfig.dockerDefaults) === null || _a === void 0 ? void 0 : _a.yarnRebuildEnabled) !== null && _b !== void 0 ? _b : true)
|
|
121
|
+
: true;
|
|
122
|
+
const yarnRebuildEnabled = "docker" in context.build.config &&
|
|
123
|
+
context.build.config.docker &&
|
|
124
|
+
"yarnRebuildEnabled" in context.build.config.docker
|
|
125
|
+
? ((_c = context.build.config.docker.yarnRebuildEnabled) !== null && _c !== void 0 ? _c : yarnRebuildEnabledDefault)
|
|
126
|
+
: yarnRebuildEnabledDefault;
|
|
127
|
+
// yarn >= 4 ships with build in plugins, see https://github.com/yarnpkg/berry/pull/4253
|
|
128
|
+
// trying to import those fail on this version
|
|
129
|
+
const doesNotShipWithBuiltInPlugins = ["2", "3"].some((v) => packageManagerInfo.version.startsWith(v));
|
|
130
|
+
const maybeAddWorkspaceToolsCommand = doesNotShipWithBuiltInPlugins
|
|
131
|
+
? "RUN yarn plugin import workspace-tools"
|
|
132
|
+
: "";
|
|
133
|
+
// copy first everything and then install
|
|
134
|
+
// rebuild first does not work as it will run postinstall and that might require files in the app
|
|
135
|
+
return new bash_1.BashExpression(`
|
|
136
|
+
ENV YARN_ENABLE_INLINE_BUILDS=1
|
|
137
|
+
${DOCKER_COPY_FILES}
|
|
138
|
+
${maybeAddWorkspaceToolsCommand}
|
|
139
|
+
RUN ${YARN_BERRY_PROD_INSTALL}
|
|
140
|
+
${yarnRebuildEnabled ? `RUN ${YARN_BERRY_PROD_REBUILD}` : ""}
|
|
141
|
+
|
|
142
|
+
`.trim());
|
|
143
|
+
};
|
|
144
|
+
exports.getDockerAppCopyAndBuildScript = getDockerAppCopyAndBuildScript;
|
|
145
|
+
//# sourceMappingURL=packageManagerInstall.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packageManagerInstall.js","sourceRoot":"","sources":["../../../../../../../../packages/pipeline/src/build/node/packageManagerInstall.ts"],"names":[],"mappings":";;;AAAA,0CAAiD;AAOjD,uCAA0C;AAC1C,+CAAyD;AAEzD,MAAM,oBAAoB,GAAG,gCAAgC,CAAC;AAE9D,MAAM,uBAAuB,GAAG,oCAAoC,CAAC;AACrE,8CAA8C;AAC9C,MAAM,uBAAuB,GAAG,cAAc,CAAC;AAE/C,MAAM,qBAAqB,GAAG,CAC5B,kBAA6D,EAC7D,EAAE;IACF,IAAI,kBAAkB,CAAC,SAAS,EAAE,CAAC;QACjC,OAAO,oBAAoB,CAAC;IAC9B,CAAC;IACD,2GAA2G;IAC3G,OAAO,0CAA0C,CAAC;AACpD,CAAC,CAAC;AAEF,MAAM,aAAa,GAAG,CACpB,OAAgB,EAChB,kBAAwE,EACxE,EAAE,CACF,OAAO,CAAC,IAAI,KAAK,WAAW;IAC5B,CAAC,wBAAwB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AC,yBAAyB,CAAC;IAEhC,wFAAwF;IACxF,8CAA8C;IAC9C,MAAM,6BAA6B,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAC1D,kBAAkB,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CACzC,CAAC;IACF,MAAM,6BAA6B,GAAG,6BAA6B;QACjE,CAAC,CAAC,wCAAwC;QAC1C,CAAC,CAAC,EAAE,CAAC;IAEP,yCAAyC;IACzC,iGAAiG;IACjG,OAAO,IAAI,qBAAc,CACvB;;EAEF,iBAAiB;EACjB,6BAA6B;MACzB,uBAAuB;EAC3B,kBAAkB,CAAC,CAAC,CAAC,OAAO,uBAAuB,EAAE,CAAC,CAAC,CAAC,EAAE;;KAEvD,CAAC,IAAI,EAAE,CACT,CAAC;AACJ,CAAC,CAAC;AApDW,QAAA,8BAA8B,kCAoDzC"}
|
|
@@ -8,7 +8,7 @@ const utils_1 = require("../../utils");
|
|
|
8
8
|
const createArtifactsConfig_1 = require("../base/createArtifactsConfig");
|
|
9
9
|
const cache_1 = require("./cache");
|
|
10
10
|
const constants_1 = require("./constants");
|
|
11
|
-
const
|
|
11
|
+
const packageManagerInstall_1 = require("./packageManagerInstall");
|
|
12
12
|
const createNodeTestJobs = async (context) => {
|
|
13
13
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3;
|
|
14
14
|
// don't run tests after release
|
|
@@ -35,8 +35,8 @@ const createNodeTestJobs = async (context) => {
|
|
|
35
35
|
needs: [],
|
|
36
36
|
};
|
|
37
37
|
const buildConfig = context.build.config;
|
|
38
|
-
const [
|
|
39
|
-
(0,
|
|
38
|
+
const [packageManagerInstall, packageManagerInfo, nodeCache] = await Promise.all([
|
|
39
|
+
(0, packageManagerInstall_1.getPackageManagerInstall)(context),
|
|
40
40
|
context.packageManagerInfo,
|
|
41
41
|
// pull-only: the build job is the designated cache writer — lint and
|
|
42
42
|
// test produce equivalent content from the same lockfile, so their
|
|
@@ -52,13 +52,11 @@ const createNodeTestJobs = async (context) => {
|
|
|
52
52
|
...((_b = (_a = buildConfig.audit) === null || _a === void 0 ? void 0 : _a.runnerVariables) !== null && _b !== void 0 ? _b : {}),
|
|
53
53
|
},
|
|
54
54
|
image: (_d = (_c = buildConfig.audit) === null || _c === void 0 ? void 0 : _c.jobImage) !== null && _d !== void 0 ? _d : defaultImage,
|
|
55
|
-
caches: undefined, // audit does not need
|
|
55
|
+
caches: undefined, // audit does not need an install and no cache
|
|
56
56
|
script: [
|
|
57
57
|
`cd ${context.build.dir}`,
|
|
58
58
|
...((_f = (0, utils_1.ensureArrayOrNull)((_e = buildConfig.audit) === null || _e === void 0 ? void 0 : _e.command)) !== null && _f !== void 0 ? _f : [
|
|
59
|
-
packageManagerInfo
|
|
60
|
-
? "yarn audit --level critical"
|
|
61
|
-
: "yarn npm audit --environment production --severity critical", // yarn 2
|
|
59
|
+
(0, packageManagerInstall_1.getDefaultAuditCommand)(packageManagerInfo),
|
|
62
60
|
]),
|
|
63
61
|
],
|
|
64
62
|
allow_failure: (_h = (_g = buildConfig.audit) === null || _g === void 0 ? void 0 : _g.allowFailure) !== null && _h !== void 0 ? _h : true,
|
|
@@ -76,9 +74,9 @@ const createNodeTestJobs = async (context) => {
|
|
|
76
74
|
image: (_p = (_o = buildConfig.lint) === null || _o === void 0 ? void 0 : _o.jobImage) !== null && _p !== void 0 ? _p : defaultImage,
|
|
77
75
|
caches: nodeCache,
|
|
78
76
|
script: [
|
|
79
|
-
...(0,
|
|
77
|
+
...(0, packageManagerInstall_1.ensureNodeVersion)(context),
|
|
80
78
|
`cd ${context.build.dir}`,
|
|
81
|
-
...
|
|
79
|
+
...packageManagerInstall,
|
|
82
80
|
...((_r = (0, utils_1.ensureArrayOrNull)((_q = buildConfig.lint) === null || _q === void 0 ? void 0 : _q.command)) !== null && _r !== void 0 ? _r : ["yarn lint"]),
|
|
83
81
|
],
|
|
84
82
|
allow_failure: (_s = buildConfig.lint) === null || _s === void 0 ? void 0 : _s.allowFailure,
|
|
@@ -96,9 +94,9 @@ const createNodeTestJobs = async (context) => {
|
|
|
96
94
|
image: (_y = (_x = buildConfig.test) === null || _x === void 0 ? void 0 : _x.jobImage) !== null && _y !== void 0 ? _y : (0, runner_1.getRunnerImage)("jobs-testing-chrome"),
|
|
97
95
|
caches: nodeCache,
|
|
98
96
|
script: [
|
|
99
|
-
...(0,
|
|
97
|
+
...(0, packageManagerInstall_1.ensureNodeVersion)(context),
|
|
100
98
|
`cd ${context.build.dir}`,
|
|
101
|
-
...
|
|
99
|
+
...packageManagerInstall,
|
|
102
100
|
...((_0 = (0, utils_1.ensureArrayOrNull)((_z = buildConfig.test) === null || _z === void 0 ? void 0 : _z.command)) !== null && _0 !== void 0 ? _0 : ["yarn test"]),
|
|
103
101
|
],
|
|
104
102
|
allow_failure: (_1 = buildConfig.test) === null || _1 === void 0 ? void 0 : _1.allowFailure,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testJob.js","sourceRoot":"","sources":["../../../../../../../../packages/pipeline/src/build/node/testJob.ts"],"names":[],"mappings":";;;AAAA,yCAA8C;AAE9C,iDAG6B;AAE7B,2CAAgD;AAChD,uCAAwD;AACxD,yEAAsE;AACtE,mCAAuC;AACvC,2CAA0D;AAC1D,
|
|
1
|
+
{"version":3,"file":"testJob.js","sourceRoot":"","sources":["../../../../../../../../packages/pipeline/src/build/node/testJob.ts"],"names":[],"mappings":";;;AAAA,yCAA8C;AAE9C,iDAG6B;AAE7B,2CAAgD;AAChD,uCAAwD;AACxD,yEAAsE;AACtE,mCAAuC;AACvC,2CAA0D;AAC1D,mEAIiC;AAE1B,MAAM,kBAAkB,GAAG,KAAK,EACrC,OAA4C,EACnB,EAAE;;IAC3B,gCAAgC;IAChC,6CAA6C;IAC7C,IAAI,OAAO,CAAC,OAAO,KAAK,eAAe,E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
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { Artifacts, EnvVars
|
|
1
|
+
import type { Artifacts, EnvVars } from "../types";
|
|
2
|
+
import type { JobImageConfig } from "../customImages/projectImages";
|
|
2
3
|
import type { Services } from "../types/gitlab-ci-yml";
|
|
3
4
|
import type { CatladderJob, CatladderJobCache } from "../types/jobs";
|
|
4
5
|
export type CacheConfigAdvanced = Omit<CatladderJobCache, "paths" | "key"> & {
|
|
@@ -80,7 +81,7 @@ export type WithCacheConfig = {
|
|
|
80
81
|
};
|
|
81
82
|
export type TestJobCustom = {
|
|
82
83
|
command?: string | string[];
|
|
83
|
-
jobImage?:
|
|
84
|
+
jobImage?: JobImageConfig;
|
|
84
85
|
/**
|
|
85
86
|
* additional CI/CD artifacts reports,
|
|
86
87
|
* use to display information in merge requests, pipeline views and security dashboards.
|
|
@@ -162,7 +163,7 @@ export type BuildConfigBase = {
|
|
|
162
163
|
/**
|
|
163
164
|
* custom image to use
|
|
164
165
|
*/
|
|
165
|
-
jobImage?:
|
|
166
|
+
jobImage?: JobImageConfig;
|
|
166
167
|
} & WithCacheConfig;
|
|
167
168
|
export type BuildConfigNodeBase = BuildConfigBase & {
|
|
168
169
|
/**
|
|
@@ -248,7 +249,7 @@ type BuildConfigDockerCustom = {
|
|
|
248
249
|
export type BuildConfigDocker = BuildConfigDockerBuiltIn | BuildConfigDockerCustom;
|
|
249
250
|
export type BuildConfigCustom = Omit<BuildConfigBase, "lint" | "test" | "audit"> & {
|
|
250
251
|
type: "custom";
|
|
251
|
-
jobImage:
|
|
252
|
+
jobImage: JobImageConfig;
|
|
252
253
|
/**
|
|
253
254
|
* {@link Services}s used in lint, test, audit, and build jobs.
|
|
254
255
|
*/
|
|
@@ -377,7 +378,7 @@ export type WorkspaceBuildConfigBase = {
|
|
|
377
378
|
* use to display information in merge requests, pipeline views and security dashboards.
|
|
378
379
|
*/
|
|
379
380
|
artifactsReports?: BuildConfigArtifactsReports;
|
|
380
|
-
jobImage?:
|
|
381
|
+
jobImage?: JobImageConfig;
|
|
381
382
|
/**
|
|
382
383
|
* tags for the underlying job runner (e.g gitlab)
|
|
383
384
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../packages/pipeline/src/build/types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../packages/pipeline/src/build/types.ts"],"names":[],"mappings":";;;AA+ZO,MAAM,uBAAuB,GAAG,CACrC,CAAsB,EACM,EAAE;IAC9B,IAAI,CAAC,CAAC;QAAE,OAAO,KAAK,CAAC;IACrB,OAAO,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC;AACxB,CAAC,CAAC;AALW,QAAA,uBAAuB,2BAKlC;AAEK,MAAM,aAAa,GAAG,CAC3B,CAAc,EACd,GAAG,KAAQ,EACqC,EAAE;IAClD,IAAI,CAAC,IAAA,+BAAuB,EAAC,CAAC,CAAC;QAAE,OAAO,KAAK,CAAC;IAC9C,OAAO,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AAChC,CAAC,CAAC;AANW,QAAA,aAAa,iBAMxB"}
|