@catladder/cli 0.0.0-next-b3e567e8 → 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/bundles/catenv/index.js +244 -67
- package/dist/bundles/cli/index.js +244 -67
- package/dist/bundles/skills/catladder-builds/SKILL.md +49 -2
- package/dist/bundles/skills/catladder-builds/references/build-types.md +2 -2
- package/dist/bundles/skills/catladder-pipelines/SKILL.md +13 -3
- 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/types.d.ts +6 -5
- package/dist/packages/pipeline/src/build/types.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/types/custom.d.ts +2 -2
- package/dist/packages/pipeline/src/deploy/types/index.d.ts +4 -4
- package/dist/packages/pipeline/src/deploy/types/pages.d.ts +2 -2
- 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/types/config.d.ts +8 -0
- package/dist/packages/pipeline/src/types/config.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/skills/catladder-builds/SKILL.md +49 -2
- package/dist/skills/catladder-builds/references/build-types.md +2 -2
- package/dist/skills/catladder-pipelines/SKILL.md +13 -3
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -8314,7 +8314,7 @@ class GithubBackend {
|
|
|
8314
8314
|
await (0, promises_1.rm)(scriptFiles_1.GITHUB_SCRIPTS_FOLDER, { recursive: true, force: true });
|
|
8315
8315
|
}
|
|
8316
8316
|
async createFiles(config) {
|
|
8317
|
-
const images = this.createImagesPlan();
|
|
8317
|
+
const images = this.createImagesPlan(config);
|
|
8318
8318
|
const scripts = new scriptFiles_1.GithubScriptFiles();
|
|
8319
8319
|
const workflows = await this.createWorkflows(config, images, scripts);
|
|
8320
8320
|
return [
|
|
@@ -8329,13 +8329,13 @@ class GithubBackend {
|
|
|
8329
8329
|
...(0, shippedCatci_1.getCatciGeneratedFiles)(),
|
|
8330
8330
|
];
|
|
8331
8331
|
}
|
|
8332
|
-
createImagesPlan() {
|
|
8333
|
-
return new jobImagesPlan_1.JobImagesPlan(this.type);
|
|
8332
|
+
createImagesPlan(config) {
|
|
8333
|
+
return new jobImagesPlan_1.JobImagesPlan(this.type, config.images);
|
|
8334
8334
|
}
|
|
8335
8335
|
/**
|
|
8336
8336
|
* all workflows keyed by file name, mainly for testing purposes
|
|
8337
8337
|
*/
|
|
8338
|
-
async createWorkflows(config, images = this.createImagesPlan(), scripts = new scriptFiles_1.GithubScriptFiles()) {
|
|
8338
|
+
async createWorkflows(config, images = this.createImagesPlan(config), scripts = new scriptFiles_1.GithubScriptFiles()) {
|
|
8339
8339
|
var _a, _b, _c, _d;
|
|
8340
8340
|
const workflows = {};
|
|
8341
8341
|
// per-pipeline-type variables (pipelines.github.runnerVariables);
|
|
@@ -9304,7 +9304,7 @@ class GitlabBackend {
|
|
|
9304
9304
|
await (0, promises_1.rm)(this.generatedFolder, { force: true, recursive: true });
|
|
9305
9305
|
}
|
|
9306
9306
|
async createFiles(config) {
|
|
9307
|
-
const images = this.createImagesPlan();
|
|
9307
|
+
const images = this.createImagesPlan(config);
|
|
9308
9308
|
const includes = await this.createIncludes(config, images);
|
|
9309
9309
|
const mainFile = {
|
|
9310
9310
|
path: ".gitlab-ci.yml",
|
|
@@ -9321,15 +9321,15 @@ class GitlabBackend {
|
|
|
9321
9321
|
...(0, shippedCatci_1.getCatciGeneratedFiles)(),
|
|
9322
9322
|
];
|
|
9323
9323
|
}
|
|
9324
|
-
createImagesPlan() {
|
|
9325
|
-
return new jobImagesPlan_1.JobImagesPlan(this.type);
|
|
9324
|
+
createImagesPlan(config) {
|
|
9325
|
+
return new jobImagesPlan_1.JobImagesPlan(this.type, config.images);
|
|
9326
9326
|
}
|
|
9327
9327
|
/**
|
|
9328
9328
|
* the complete pipeline as one object (all includes merged into one),
|
|
9329
9329
|
* mainly for testing purposes
|
|
9330
9330
|
*/
|
|
9331
9331
|
async createCompletePipeline(config) {
|
|
9332
|
-
const includes = await this.createIncludes(config, this.createImagesPlan());
|
|
9332
|
+
const includes = await this.createIncludes(config, this.createImagesPlan(config));
|
|
9333
9333
|
return includes.reduce((acc, { content }) => {
|
|
9334
9334
|
return {
|
|
9335
9335
|
...acc,
|
|
@@ -12974,7 +12974,7 @@ exports.makeSecretEnvVarMapping = makeSecretEnvVarMapping;
|
|
|
12974
12974
|
"use strict";
|
|
12975
12975
|
|
|
12976
12976
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
12977
|
-
exports.computeCustomImageHash = void 0;
|
|
12977
|
+
exports.computeInlineImageHash = exports.computeCustomImageHash = void 0;
|
|
12978
12978
|
const crypto_1 = __nccwpck_require__(76982);
|
|
12979
12979
|
const fs_1 = __nccwpck_require__(79896);
|
|
12980
12980
|
const path_1 = __nccwpck_require__(16928);
|
|
@@ -12995,6 +12995,29 @@ function listFilesRecursive(dir) {
|
|
|
12995
12995
|
})
|
|
12996
12996
|
.sort();
|
|
12997
12997
|
}
|
|
12998
|
+
/**
|
|
12999
|
+
* the parts every image definition hashes on top of its content:
|
|
13000
|
+
* files outside the definition, and the build args
|
|
13001
|
+
*/
|
|
13002
|
+
function hashExtras(hash, config) {
|
|
13003
|
+
const watchedPaths = [];
|
|
13004
|
+
// Hash extra paths (for files outside the dir)
|
|
13005
|
+
if (config.hashExtraPaths) {
|
|
13006
|
+
// Extra paths are literal file paths (not globs) for simplicity
|
|
13007
|
+
const extraFiles = [...config.hashExtraPaths].sort();
|
|
13008
|
+
for (const file of extraFiles) {
|
|
13009
|
+
hash.update(file);
|
|
13010
|
+
hash.update((0, fs_1.readFileSync)(file));
|
|
13011
|
+
}
|
|
13012
|
+
watchedPaths.push(...config.hashExtraPaths);
|
|
13013
|
+
}
|
|
13014
|
+
// Hash build args (sorted keys for determinism)
|
|
13015
|
+
if (config.buildArgs) {
|
|
13016
|
+
const sorted = Object.entries(config.buildArgs).sort(([a], [b]) => a.localeCompare(b));
|
|
13017
|
+
hash.update(JSON.stringify(sorted));
|
|
13018
|
+
}
|
|
13019
|
+
return watchedPaths;
|
|
13020
|
+
}
|
|
12998
13021
|
function computeCustomImageHash(config) {
|
|
12999
13022
|
var _a;
|
|
13000
13023
|
const hash = (0, crypto_1.createHash)("sha256");
|
|
@@ -13015,27 +13038,29 @@ function computeCustomImageHash(config) {
|
|
|
13015
13038
|
}
|
|
13016
13039
|
watchedPaths.push(`${extraDir}/**/*`);
|
|
13017
13040
|
}
|
|
13018
|
-
|
|
13019
|
-
if (config.hashExtraPaths) {
|
|
13020
|
-
// Extra paths are literal file paths (not globs) for simplicity
|
|
13021
|
-
const extraFiles = [...config.hashExtraPaths].sort();
|
|
13022
|
-
for (const file of extraFiles) {
|
|
13023
|
-
hash.update(file);
|
|
13024
|
-
hash.update((0, fs_1.readFileSync)(file));
|
|
13025
|
-
}
|
|
13026
|
-
watchedPaths.push(...config.hashExtraPaths);
|
|
13027
|
-
}
|
|
13028
|
-
// Hash build args (sorted keys for determinism)
|
|
13029
|
-
if (config.buildArgs) {
|
|
13030
|
-
const sorted = Object.entries(config.buildArgs).sort(([a], [b]) => a.localeCompare(b));
|
|
13031
|
-
hash.update(JSON.stringify(sorted));
|
|
13032
|
-
}
|
|
13041
|
+
watchedPaths.push(...hashExtras(hash, config));
|
|
13033
13042
|
return {
|
|
13034
13043
|
hash: hash.digest("hex").slice(0, 12),
|
|
13035
13044
|
watchedPaths,
|
|
13036
13045
|
};
|
|
13037
13046
|
}
|
|
13038
13047
|
exports.computeCustomImageHash = computeCustomImageHash;
|
|
13048
|
+
/**
|
|
13049
|
+
* the hash of an image defined by an inline Dockerfile: its content
|
|
13050
|
+
* stands in for the definition dir. The build context is deliberately
|
|
13051
|
+
* NOT hashed (it may be the whole repository) — `hashExtraPaths` is how
|
|
13052
|
+
* context files opt into the hash.
|
|
13053
|
+
*/
|
|
13054
|
+
function computeInlineImageHash(config) {
|
|
13055
|
+
const hash = (0, crypto_1.createHash)("sha256");
|
|
13056
|
+
hash.update(config.dockerfileContent);
|
|
13057
|
+
const watchedPaths = hashExtras(hash, config);
|
|
13058
|
+
return {
|
|
13059
|
+
hash: hash.digest("hex").slice(0, 12),
|
|
13060
|
+
watchedPaths,
|
|
13061
|
+
};
|
|
13062
|
+
}
|
|
13063
|
+
exports.computeInlineImageHash = computeInlineImageHash;
|
|
13039
13064
|
//# sourceMappingURL=hash.js.map
|
|
13040
13065
|
|
|
13041
13066
|
/***/ }),
|
|
@@ -13046,7 +13071,7 @@ exports.computeCustomImageHash = computeCustomImageHash;
|
|
|
13046
13071
|
"use strict";
|
|
13047
13072
|
|
|
13048
13073
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
13049
|
-
exports.JobImagesPlan = exports.GENERATED_IMAGES_FOLDER = void 0;
|
|
13074
|
+
exports.JobImagesPlan = exports.PROJECT_IMAGES_FOLDER = exports.GENERATED_IMAGES_FOLDER = void 0;
|
|
13050
13075
|
const fs_1 = __nccwpck_require__(79896);
|
|
13051
13076
|
const path_1 = __nccwpck_require__(16928);
|
|
13052
13077
|
const ciVariables_1 = __nccwpck_require__(72700);
|
|
@@ -13054,6 +13079,7 @@ const docker_1 = __nccwpck_require__(83777);
|
|
|
13054
13079
|
const runner_1 = __nccwpck_require__(71065);
|
|
13055
13080
|
const gitlab_1 = __nccwpck_require__(37393);
|
|
13056
13081
|
const hash_1 = __nccwpck_require__(34092);
|
|
13082
|
+
const projectImages_1 = __nccwpck_require__(55537);
|
|
13057
13083
|
const shippedImages_1 = __nccwpck_require__(28687);
|
|
13058
13084
|
exports.GENERATED_IMAGES_FOLDER = ".catladder-generated/images";
|
|
13059
13085
|
/**
|
|
@@ -13061,7 +13087,44 @@ exports.GENERATED_IMAGES_FOLDER = ".catladder-generated/images";
|
|
|
13061
13087
|
* catladder image, so building images never depends on one (bootstrap)
|
|
13062
13088
|
*/
|
|
13063
13089
|
const BUILDER_IMAGE = "docker.io/docker:29.5.1";
|
|
13064
|
-
|
|
13090
|
+
/**
|
|
13091
|
+
* every planned image is consumed the same way: its url, plus an
|
|
13092
|
+
* optional dependency on its build job
|
|
13093
|
+
*/
|
|
13094
|
+
const toResolvedJobImage = ({ imageRef, jobName, }) => ({
|
|
13095
|
+
image: imageRef,
|
|
13096
|
+
fromRepoRegistry: true,
|
|
13097
|
+
need: {
|
|
13098
|
+
job: jobName,
|
|
13099
|
+
artifacts: false,
|
|
13100
|
+
optional: true,
|
|
13101
|
+
global: true,
|
|
13102
|
+
},
|
|
13103
|
+
});
|
|
13104
|
+
/**
|
|
13105
|
+
* materializes an image definition directory into the generated files
|
|
13106
|
+
* (used for the definitions catladder ships)
|
|
13107
|
+
*/
|
|
13108
|
+
const materializeDir = (sourceDir, targetDir) => listFilesRecursive(sourceDir).map((file) => ({
|
|
13109
|
+
path: (0, path_1.join)(targetDir, file),
|
|
13110
|
+
content: (0, fs_1.readFileSync)((0, path_1.join)(sourceDir, file), "utf-8"),
|
|
13111
|
+
}));
|
|
13112
|
+
// built-in (catladder-shipped) images carry the catladder marker in
|
|
13113
|
+
// their job name; project-declared images get the short plain name
|
|
13114
|
+
const ensureJobName = (name) => `🐳 catladder image ${name}`;
|
|
13115
|
+
const projectEnsureJobName = (name) => `🐳 image ${name}`;
|
|
13116
|
+
/**
|
|
13117
|
+
* the config file whose content feeds the project image hashes
|
|
13118
|
+
* (`buildArgs`, `hashExtraPaths`): the gitlab change detection has to
|
|
13119
|
+
* watch it, because a config-only change alters the image tag without
|
|
13120
|
+
* touching the image dir
|
|
13121
|
+
*/
|
|
13122
|
+
const CONFIG_FILE = "catladder.ts";
|
|
13123
|
+
/**
|
|
13124
|
+
* where inline project Dockerfiles are materialized — a subfolder, so a
|
|
13125
|
+
* project image can carry the same name as a shipped one
|
|
13126
|
+
*/
|
|
13127
|
+
exports.PROJECT_IMAGES_FOLDER = `${exports.GENERATED_IMAGES_FOLDER}/project`;
|
|
13065
13128
|
/**
|
|
13066
13129
|
* plans the catladder job images of one backend run: resolves image
|
|
13067
13130
|
* references, collects the image build jobs, and the image definitions
|
|
@@ -13072,33 +13135,30 @@ const ensureJobName = (name) => `🐳 job image ${name}`;
|
|
|
13072
13135
|
* Reference-driven: only images actually used by a job are built.
|
|
13073
13136
|
*/
|
|
13074
13137
|
class JobImagesPlan {
|
|
13075
|
-
constructor(pipelineType) {
|
|
13138
|
+
constructor(pipelineType, projectImages = {}) {
|
|
13076
13139
|
this.pipelineType = pipelineType;
|
|
13140
|
+
this.projectImages = projectImages;
|
|
13077
13141
|
this.used = new Map();
|
|
13142
|
+
this.usedProject = new Map();
|
|
13078
13143
|
}
|
|
13079
13144
|
/**
|
|
13080
13145
|
* resolves a job image (marker or concrete) to a concrete image url
|
|
13081
13146
|
* plus the build job dependency
|
|
13082
13147
|
*/
|
|
13083
13148
|
resolve(image) {
|
|
13084
|
-
if (
|
|
13085
|
-
return
|
|
13149
|
+
if ((0, runner_1.isCatladderImageRef)(image)) {
|
|
13150
|
+
return this.resolveRef(image);
|
|
13151
|
+
}
|
|
13152
|
+
if ((0, projectImages_1.isProjectImageRef)(image)) {
|
|
13153
|
+
return this.resolveProjectRef(image);
|
|
13086
13154
|
}
|
|
13087
|
-
return
|
|
13155
|
+
return { image };
|
|
13088
13156
|
}
|
|
13089
13157
|
resolveRef(ref) {
|
|
13090
|
-
|
|
13091
|
-
|
|
13092
|
-
|
|
13093
|
-
|
|
13094
|
-
fromRepoRegistry: true,
|
|
13095
|
-
need: {
|
|
13096
|
-
job: ensureJobName(name),
|
|
13097
|
-
artifacts: false,
|
|
13098
|
-
optional: true,
|
|
13099
|
-
global: true,
|
|
13100
|
-
},
|
|
13101
|
-
};
|
|
13158
|
+
return toResolvedJobImage(this.use(ref.catladderImage));
|
|
13159
|
+
}
|
|
13160
|
+
resolveProjectRef(ref) {
|
|
13161
|
+
return toResolvedJobImage(this.useProject(ref.image));
|
|
13102
13162
|
}
|
|
13103
13163
|
/**
|
|
13104
13164
|
* the registry image prefix. On github, container images can't use
|
|
@@ -13109,6 +13169,85 @@ class JobImagesPlan {
|
|
|
13109
13169
|
? "ghcr.io/${{ github.repository }}"
|
|
13110
13170
|
: `${(0, ciVariables_1.getCiVariable)({ pipelineType: this.pipelineType }, "registryImage")}`;
|
|
13111
13171
|
}
|
|
13172
|
+
useProject(name) {
|
|
13173
|
+
const existing = this.usedProject.get(name);
|
|
13174
|
+
if (existing) {
|
|
13175
|
+
return existing;
|
|
13176
|
+
}
|
|
13177
|
+
const imageConfig = this.projectImages[name];
|
|
13178
|
+
if (!imageConfig) {
|
|
13179
|
+
const declared = Object.keys(this.projectImages);
|
|
13180
|
+
throw new Error(`unknown job image "${name}" — ${declared.length > 0
|
|
13181
|
+
? `images declared in config.images: ${declared.join(", ")}`
|
|
13182
|
+
: "no images are declared in config.images"}`);
|
|
13183
|
+
}
|
|
13184
|
+
const source = this.planProjectSource(name, imageConfig);
|
|
13185
|
+
const planned = {
|
|
13186
|
+
...source,
|
|
13187
|
+
jobName: projectEnsureJobName(name),
|
|
13188
|
+
buildArgs: imageConfig.buildArgs,
|
|
13189
|
+
// `job-images/` keeps the project's job images apart from its
|
|
13190
|
+
// deployable component images (registry root) and build caches
|
|
13191
|
+
imageRef: `${this.registryImageRef()}/job-images/${name}:${source.hash}`,
|
|
13192
|
+
};
|
|
13193
|
+
this.usedProject.set(name, planned);
|
|
13194
|
+
return planned;
|
|
13195
|
+
}
|
|
13196
|
+
/**
|
|
13197
|
+
* the source-dependent half of a project image: an inline Dockerfile
|
|
13198
|
+
* is materialized into the generated files and hashed by its content,
|
|
13199
|
+
* a directory is hashed and watched in place
|
|
13200
|
+
*/
|
|
13201
|
+
planProjectSource(name, imageConfig) {
|
|
13202
|
+
var _a, _b;
|
|
13203
|
+
if (imageConfig.dockerfile !== undefined) {
|
|
13204
|
+
const content = toDockerfileContent(imageConfig.dockerfile);
|
|
13205
|
+
const dockerfilePath = `${exports.PROJECT_IMAGES_FOLDER}/${name}/Dockerfile`;
|
|
13206
|
+
const { hash, watchedPaths } = (0, hash_1.computeInlineImageHash)({
|
|
13207
|
+
dockerfileContent: content,
|
|
13208
|
+
hashExtraPaths: imageConfig.hashExtraPaths,
|
|
13209
|
+
buildArgs: imageConfig.buildArgs,
|
|
13210
|
+
});
|
|
13211
|
+
return {
|
|
13212
|
+
hash,
|
|
13213
|
+
dockerfilePath,
|
|
13214
|
+
// an inline definition carries no directory of its own — the
|
|
13215
|
+
// repository root is the sensible default context
|
|
13216
|
+
contextDir: (_a = imageConfig.context) !== null && _a !== void 0 ? _a : ".",
|
|
13217
|
+
watchedPaths: [
|
|
13218
|
+
`${exports.PROJECT_IMAGES_FOLDER}/${name}/**/*`,
|
|
13219
|
+
...watchedPaths,
|
|
13220
|
+
CONFIG_FILE,
|
|
13221
|
+
],
|
|
13222
|
+
files: [{ path: dockerfilePath, content }],
|
|
13223
|
+
};
|
|
13224
|
+
}
|
|
13225
|
+
const dir = imageConfig.dir;
|
|
13226
|
+
// fail at generation time with the offending image named: an
|
|
13227
|
+
// unreadable dir would otherwise surface as a bare fs ENOENT, and a
|
|
13228
|
+
// missing Dockerfile only as a docker build failure in CI
|
|
13229
|
+
if (!(0, fs_1.existsSync)(dir)) {
|
|
13230
|
+
throw new Error(`job image "${name}": the directory "${dir}" does not exist (config.images.${name}.dir, relative to the repository root)`);
|
|
13231
|
+
}
|
|
13232
|
+
if (!(0, fs_1.existsSync)((0, path_1.join)(dir, "Dockerfile"))) {
|
|
13233
|
+
throw new Error(`job image "${name}": no Dockerfile in "${dir}" (config.images.${name}.dir)`);
|
|
13234
|
+
}
|
|
13235
|
+
const { hash, watchedPaths } = (0, hash_1.computeCustomImageHash)({
|
|
13236
|
+
dir,
|
|
13237
|
+
hashExtraPaths: imageConfig.hashExtraPaths,
|
|
13238
|
+
buildArgs: imageConfig.buildArgs,
|
|
13239
|
+
});
|
|
13240
|
+
return {
|
|
13241
|
+
hash,
|
|
13242
|
+
dockerfilePath: `${dir}/Dockerfile`,
|
|
13243
|
+
contextDir: (_b = imageConfig.context) !== null && _b !== void 0 ? _b : dir,
|
|
13244
|
+
// the dir is committed in the project — watched in place, nothing
|
|
13245
|
+
// is materialized. The config file is watched too: buildArgs /
|
|
13246
|
+
// hashExtraPaths changes alter the tag without touching the dir
|
|
13247
|
+
watchedPaths: [...watchedPaths, CONFIG_FILE],
|
|
13248
|
+
files: [],
|
|
13249
|
+
};
|
|
13250
|
+
}
|
|
13112
13251
|
use(name) {
|
|
13113
13252
|
var _a;
|
|
13114
13253
|
const existing = this.used.get(name);
|
|
@@ -13123,27 +13262,43 @@ class JobImagesPlan {
|
|
|
13123
13262
|
dir: (0, shippedImages_1.getShippedImageDir)(name),
|
|
13124
13263
|
extraDirs: dependencies.map((dependency) => (0, shippedImages_1.getShippedImageDir)(dependency)),
|
|
13125
13264
|
});
|
|
13126
|
-
const
|
|
13127
|
-
|
|
13128
|
-
|
|
13265
|
+
const targetDir = `${exports.GENERATED_IMAGES_FOLDER}/${name}`;
|
|
13266
|
+
const planned = {
|
|
13267
|
+
hash,
|
|
13268
|
+
jobName: ensureJobName(name),
|
|
13269
|
+
imageRef: `${this.registryImageRef()}/catladder/${name}:${hash}`,
|
|
13270
|
+
dockerfilePath: `${targetDir}/Dockerfile`,
|
|
13271
|
+
// the jobs family INCLUDEs sibling images, so it builds from the
|
|
13272
|
+
// images root; the others from their own dir
|
|
13273
|
+
contextDir: shippedImages_1.RUNNER_IMAGE_BUILD_CONTEXT[name] === "root"
|
|
13274
|
+
? exports.GENERATED_IMAGES_FOLDER
|
|
13275
|
+
: targetDir,
|
|
13276
|
+
watchedPaths: [name, ...dependencies].map((dir) => `${exports.GENERATED_IMAGES_FOLDER}/${dir}/**/*`),
|
|
13277
|
+
// pipelines build from committed, reviewable files (and gitlab's
|
|
13278
|
+
// rules:changes can watch them)
|
|
13279
|
+
files: materializeDir((0, shippedImages_1.getShippedImageDir)(name), targetDir),
|
|
13280
|
+
};
|
|
13281
|
+
this.used.set(name, planned);
|
|
13282
|
+
return planned;
|
|
13129
13283
|
}
|
|
13130
13284
|
/**
|
|
13131
13285
|
* the image build jobs for all used images
|
|
13132
13286
|
*/
|
|
13133
13287
|
getEnsureJobs() {
|
|
13134
|
-
return [...this.used.
|
|
13288
|
+
return [...this.used.values(), ...this.usedProject.values()].map((planned) => this.createImageBuildJob(planned));
|
|
13135
13289
|
}
|
|
13136
|
-
|
|
13137
|
-
|
|
13290
|
+
createImageBuildJob({ jobName, imageRef, watchedPaths, dockerfilePath, contextDir, buildArgs, }) {
|
|
13291
|
+
const buildArgFlags = Object.entries(buildArgs !== null && buildArgs !== void 0 ? buildArgs : {})
|
|
13292
|
+
.map(([key, value]) => ` --build-arg '${key}=${value}'`)
|
|
13293
|
+
.join("");
|
|
13294
|
+
const buildCommand = `DOCKER_BUILDKIT=1 docker build -t ${imageRef}${buildArgFlags} -f ${dockerfilePath} ${contextDir}`;
|
|
13138
13295
|
const ctx = { pipelineType: this.pipelineType };
|
|
13139
13296
|
const registryUser = (0, ciVariables_1.getCiVariable)(ctx, "registryUser");
|
|
13140
13297
|
const jobToken = (0, ciVariables_1.getCiVariable)(ctx, "jobToken");
|
|
13141
13298
|
const registry = (0, ciVariables_1.getCiVariable)(ctx, "registry");
|
|
13142
|
-
const imageRef = `${this.registryImageRef()}/catladder/${name}:${hash}`;
|
|
13143
|
-
const watchedDirs = [name, ...((_a = shippedImages_1.RUNNER_IMAGE_DEPENDENCIES[name]) !== null && _a !== void 0 ? _a : [])];
|
|
13144
13299
|
const { services, runnerVariables } = (0, docker_1.getDockerJobBaseProps)();
|
|
13145
13300
|
return {
|
|
13146
|
-
name:
|
|
13301
|
+
name: jobName,
|
|
13147
13302
|
stage: "setup",
|
|
13148
13303
|
image: BUILDER_IMAGE,
|
|
13149
13304
|
services,
|
|
@@ -13153,7 +13308,9 @@ class JobImagesPlan {
|
|
|
13153
13308
|
// no equivalent and always runs (the existence check is fast)
|
|
13154
13309
|
rules: [
|
|
13155
13310
|
{
|
|
13156
|
-
|
|
13311
|
+
// a fresh array per job: the yaml serializer anchors repeated
|
|
13312
|
+
// objects, and a shared reference would reshuffle anchors
|
|
13313
|
+
changes: [...watchedPaths],
|
|
13157
13314
|
},
|
|
13158
13315
|
],
|
|
13159
13316
|
variables: {},
|
|
@@ -13167,31 +13324,33 @@ class JobImagesPlan {
|
|
|
13167
13324
|
` exit 0`,
|
|
13168
13325
|
`fi`,
|
|
13169
13326
|
]),
|
|
13170
|
-
...(0, gitlab_1.collapseableSection)("docker-build", "Building image")([
|
|
13171
|
-
`DOCKER_BUILDKIT=1 docker build -t ${imageRef} -f ${exports.GENERATED_IMAGES_FOLDER}/${name}/Dockerfile ${shippedImages_1.RUNNER_IMAGE_BUILD_CONTEXT[name] === "root"
|
|
13172
|
-
? exports.GENERATED_IMAGES_FOLDER
|
|
13173
|
-
: `${exports.GENERATED_IMAGES_FOLDER}/${name}`}`,
|
|
13174
|
-
]),
|
|
13327
|
+
...(0, gitlab_1.collapseableSection)("docker-build", "Building image")([buildCommand]),
|
|
13175
13328
|
...(0, gitlab_1.collapseableSection)("docker-push", "Pushing image")([`docker push ${imageRef}`]),
|
|
13176
13329
|
],
|
|
13177
13330
|
};
|
|
13178
13331
|
}
|
|
13179
13332
|
/**
|
|
13180
|
-
* the image definitions
|
|
13181
|
-
*
|
|
13182
|
-
*
|
|
13333
|
+
* the image definitions to materialize into the generated files (so
|
|
13334
|
+
* pipelines build from committed, reviewable files and gitlab's
|
|
13335
|
+
* rules:changes can watch them): the definitions catladder ships and
|
|
13336
|
+
* the project's inline Dockerfiles. A project image directory is
|
|
13337
|
+
* already committed and contributes nothing.
|
|
13183
13338
|
*/
|
|
13184
13339
|
getGeneratedFiles() {
|
|
13185
|
-
return [...this.used.
|
|
13186
|
-
const dir = (0, shippedImages_1.getShippedImageDir)(name);
|
|
13187
|
-
return listFilesRecursive(dir).map((file) => ({
|
|
13188
|
-
path: (0, path_1.join)(exports.GENERATED_IMAGES_FOLDER, name, file),
|
|
13189
|
-
content: (0, fs_1.readFileSync)((0, path_1.join)(dir, file), "utf-8"),
|
|
13190
|
-
}));
|
|
13191
|
-
});
|
|
13340
|
+
return [...this.used.values(), ...this.usedProject.values()].flatMap(({ files }) => files);
|
|
13192
13341
|
}
|
|
13193
13342
|
}
|
|
13194
13343
|
exports.JobImagesPlan = JobImagesPlan;
|
|
13344
|
+
/**
|
|
13345
|
+
* an inline Dockerfile is written as given — as one string, or as lines
|
|
13346
|
+
* joined with newlines (always newline-terminated)
|
|
13347
|
+
*/
|
|
13348
|
+
const toDockerfileContent = (dockerfile) => {
|
|
13349
|
+
const content = Array.isArray(dockerfile)
|
|
13350
|
+
? dockerfile.join("\n")
|
|
13351
|
+
: dockerfile;
|
|
13352
|
+
return content.endsWith("\n") ? content : `${content}\n`;
|
|
13353
|
+
};
|
|
13195
13354
|
const IGNORED_FILES = new Set([".DS_Store", "Thumbs.db"]);
|
|
13196
13355
|
const listFilesRecursive = (dir) => (0, fs_1.readdirSync)(dir, { recursive: true, encoding: "utf-8" })
|
|
13197
13356
|
.filter((entry) => {
|
|
@@ -13205,6 +13364,22 @@ const listFilesRecursive = (dir) => (0, fs_1.readdirSync)(dir, { recursive: true
|
|
|
13205
13364
|
|
|
13206
13365
|
/***/ }),
|
|
13207
13366
|
|
|
13367
|
+
/***/ 55537:
|
|
13368
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
13369
|
+
|
|
13370
|
+
"use strict";
|
|
13371
|
+
|
|
13372
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
13373
|
+
exports.isProjectImageRef = void 0;
|
|
13374
|
+
const isProjectImageRef = (value) => typeof value === "object" &&
|
|
13375
|
+
value !== null &&
|
|
13376
|
+
"image" in value &&
|
|
13377
|
+
typeof value.image === "string";
|
|
13378
|
+
exports.isProjectImageRef = isProjectImageRef;
|
|
13379
|
+
//# sourceMappingURL=projectImages.js.map
|
|
13380
|
+
|
|
13381
|
+
/***/ }),
|
|
13382
|
+
|
|
13208
13383
|
/***/ 28687:
|
|
13209
13384
|
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
|
13210
13385
|
|
|
@@ -15918,6 +16093,8 @@ __exportStar(__nccwpck_require__(68906), exports);
|
|
|
15918
16093
|
__exportStar(__nccwpck_require__(23040), exports);
|
|
15919
16094
|
__exportStar(__nccwpck_require__(35086), exports);
|
|
15920
16095
|
__exportStar(__nccwpck_require__(71065), exports);
|
|
16096
|
+
__exportStar(__nccwpck_require__(55537), exports);
|
|
16097
|
+
__exportStar(__nccwpck_require__(47864), exports);
|
|
15921
16098
|
__exportStar(__nccwpck_require__(80769), exports);
|
|
15922
16099
|
__exportStar(__nccwpck_require__(7732), exports);
|
|
15923
16100
|
__exportStar(__nccwpck_require__(66526), exports);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: catladder-builds
|
|
3
|
-
description: Configuring how a component is built in a catladder project — the `build` config in catladder.ts (build types node / rails / meteor / custom, build & start commands, artifacts, caching, lint/test/audit jobs, the Docker image, and shared workspace builds). Use when adding or changing a component's build, choosing a build type, wiring a Dockerfile/nginx image, tuning the build/test/lint jobs, or setting up a monorepo workspace build. Triggers on "build config", "buildCommand", "build type", "Dockerfile", "docker image", "rails build", "monorepo build", "artifacts".
|
|
3
|
+
description: Configuring how a component is built in a catladder project — the `build` config in catladder.ts (build types node / rails / meteor / custom, build & start commands, artifacts, caching, lint/test/audit jobs, the Docker image, project-declared job images, and shared workspace builds). Use when adding or changing a component's build, choosing a build type, wiring a Dockerfile/nginx image, declaring a custom CI job image (`images` config), tuning the build/test/lint jobs, or setting up a monorepo workspace build. Triggers on "build config", "buildCommand", "build type", "Dockerfile", "docker image", "job image", "jobImage", "custom image", "project image", "rails build", "monorepo build", "artifacts".
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Component builds with catladder
|
|
@@ -71,11 +71,58 @@ type: `build: { from: "web" }` (see workspace builds below).
|
|
|
71
71
|
- `cache` — build caching (see the `catladder-pipelines` skill for the
|
|
72
72
|
caching model).
|
|
73
73
|
- `jobImage`, `jobTags`, `jobVars`, `runnerVariables` — the CI image,
|
|
74
|
-
runner tags, build-only env vars, and extra runner variables.
|
|
74
|
+
runner tags, build-only env vars, and extra runner variables. A
|
|
75
|
+
`jobImage` is a concrete image url or `{ image: "<name>" }`
|
|
76
|
+
referencing a project image (see below).
|
|
75
77
|
- `docker` — the image build strategy: a built-in
|
|
76
78
|
(`{ type: "nginx" | "node" | "meteor" }`) or
|
|
77
79
|
`{ type: "custom" }` (expects a `Dockerfile`).
|
|
78
80
|
|
|
81
|
+
## Project images (custom CI job images)
|
|
82
|
+
|
|
83
|
+
When a job needs a toolchain catladder doesn't ship (Java, Playwright,
|
|
84
|
+
…), declare a Docker image at the top level under `images` and reference
|
|
85
|
+
it in any `jobImage` field (build, `test.jobImage`, custom/pages deploy,
|
|
86
|
+
verify):
|
|
87
|
+
|
|
88
|
+
```ts
|
|
89
|
+
images: {
|
|
90
|
+
// (a) a directory in the repo (default context = the dir)
|
|
91
|
+
"java-build": {
|
|
92
|
+
dir: "docker/java-build", // contains the Dockerfile
|
|
93
|
+
buildArgs: { MAVEN_VERSION: "3.9.9" }, // optional, part of the content hash
|
|
94
|
+
hashExtraPaths: ["shared/settings.xml"], // optional extra hashed+watched files
|
|
95
|
+
},
|
|
96
|
+
// (b) inline (default context = repo root); materialized into
|
|
97
|
+
// .catladder-generated/images/project/<name>/Dockerfile
|
|
98
|
+
"db-tools": {
|
|
99
|
+
dockerfile: ["FROM alpine:3.21", "RUN apk add --no-cache postgresql17-client"],
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
components: {
|
|
103
|
+
api: {
|
|
104
|
+
build: { type: "custom", jobImage: { image: "java-build" }, docker: { type: "custom" } },
|
|
105
|
+
},
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
`dir` and `dockerfile` are mutually exclusive. `context` overrides the
|
|
110
|
+
build context (relative to the repo root) — needed when the image
|
|
111
|
+
`COPY`s files from outside its `dir`.
|
|
112
|
+
|
|
113
|
+
Catladder generates a `🐳 image <name>` job (setup stage) that builds
|
|
114
|
+
the image content-hashed into the project registry
|
|
115
|
+
(`…/job-images/<name>:<hash>`) and skips when it already exists — works
|
|
116
|
+
on GitLab and GitHub.
|
|
117
|
+
|
|
118
|
+
**The build context is not hashed** (it can be the whole repo) — only
|
|
119
|
+
the Dockerfile / `dir`, `buildArgs` and `hashExtraPaths` are. Files
|
|
120
|
+
pulled in via `COPY` that should trigger a rebuild belong in
|
|
121
|
+
`hashExtraPaths`.
|
|
122
|
+
|
|
123
|
+
Generation (`yarn catenv`) fails fast on an undeclared image name, a
|
|
124
|
+
missing `dir`, or a `dir` without a `Dockerfile`.
|
|
125
|
+
|
|
79
126
|
## Workspace builds (monorepos)
|
|
80
127
|
|
|
81
128
|
For a shared build across several components, declare it once at the top
|
|
@@ -19,7 +19,7 @@ generated pipeline files.
|
|
|
19
19
|
| `jobVars` | `EnvVars` | env vars only in build jobs |
|
|
20
20
|
| `runnerVariables` | `Record<string,string>` | extra runner vars (also for `services:`) |
|
|
21
21
|
| `jobTags` | `string[]` | runner tags |
|
|
22
|
-
| `jobImage` | `
|
|
22
|
+
| `jobImage` | `JobImageConfig` | CI image for the build: a concrete image or `{ image: "<name>" }` referencing a project image |
|
|
23
23
|
| `docker` | see below | the deployable image strategy |
|
|
24
24
|
|
|
25
25
|
`TestJobCustom` (for `lint`/`test`/`audit`): `command`, `jobImage`,
|
|
@@ -48,7 +48,7 @@ generated pipeline files.
|
|
|
48
48
|
|
|
49
49
|
### `custom`
|
|
50
50
|
- `type: "custom"` — **required**.
|
|
51
|
-
- `jobImage:
|
|
51
|
+
- `jobImage: JobImageConfig` — **required** CI image (concrete image or `{ image: "<name>" }` project-image ref).
|
|
52
52
|
- `docker: BuildConfigDocker` — **required** image build config.
|
|
53
53
|
- `jobServices?: Services` — services for lint/test/audit/build jobs.
|
|
54
54
|
- `lint?` / `test?` / `audit?: TestJobCustom` — disabled unless set.
|
|
@@ -29,13 +29,23 @@ plus stop jobs for review-app teardown.
|
|
|
29
29
|
|
|
30
30
|
## Job images and catci
|
|
31
31
|
|
|
32
|
-
Jobs run in catladder-provided images
|
|
33
|
-
|
|
34
|
-
project's own registry
|
|
32
|
+
Jobs run in catladder-provided images (`🐳 catladder image <name>` build
|
|
33
|
+
jobs). Their definitions are materialized into
|
|
34
|
+
`.catladder-generated/images/` and built in the project's own registry
|
|
35
|
+
under `catladder/` (content-hashed, rebuilt only on change).
|
|
35
36
|
`.catladder-generated/catci/` holds a small bundled CI companion used by
|
|
36
37
|
generated jobs (e.g. the release security audit) — all generated, never
|
|
37
38
|
edit.
|
|
38
39
|
|
|
40
|
+
Projects can declare their own job images under `images` in
|
|
41
|
+
`catladder.ts` (`🐳 image <name>` build jobs, pushed to `job-images/` in
|
|
42
|
+
the registry) and reference them in any `jobImage` field via
|
|
43
|
+
`{ image: "<name>" }` — see the `catladder-builds` skill. A declared
|
|
44
|
+
Dockerfile directory is used in place; an inline `dockerfile` is
|
|
45
|
+
materialized into `.catladder-generated/images/project/<name>/`. Either
|
|
46
|
+
way the build job is skipped when the content hash already exists in
|
|
47
|
+
the registry.
|
|
48
|
+
|
|
39
49
|
## Caching
|
|
40
50
|
|
|
41
51
|
Cache configuration is generated per build type; node builds cache
|
|
@@ -54,7 +54,7 @@ class GithubBackend {
|
|
|
54
54
|
await (0, promises_1.rm)(scriptFiles_1.GITHUB_SCRIPTS_FOLDER, { recursive: true, force: true });
|
|
55
55
|
}
|
|
56
56
|
async createFiles(config) {
|
|
57
|
-
const images = this.createImagesPlan();
|
|
57
|
+
const images = this.createImagesPlan(config);
|
|
58
58
|
const scripts = new scriptFiles_1.GithubScriptFiles();
|
|
59
59
|
const workflows = await this.createWorkflows(config, images, scripts);
|
|
60
60
|
return [
|
|
@@ -69,13 +69,13 @@ class GithubBackend {
|
|
|
69
69
|
...(0, shippedCatci_1.getCatciGeneratedFiles)(),
|
|
70
70
|
];
|
|
71
71
|
}
|
|
72
|
-
createImagesPlan() {
|
|
73
|
-
return new jobImagesPlan_1.JobImagesPlan(this.type);
|
|
72
|
+
createImagesPlan(config) {
|
|
73
|
+
return new jobImagesPlan_1.JobImagesPlan(this.type, config.images);
|
|
74
74
|
}
|
|
75
75
|
/**
|
|
76
76
|
* all workflows keyed by file name, mainly for testing purposes
|
|
77
77
|
*/
|
|
78
|
-
async createWorkflows(config, images = this.createImagesPlan(), scripts = new scriptFiles_1.GithubScriptFiles()) {
|
|
78
|
+
async createWorkflows(config, images = this.createImagesPlan(config), scripts = new scriptFiles_1.GithubScriptFiles()) {
|
|
79
79
|
var _a, _b, _c, _d;
|
|
80
80
|
const workflows = {};
|
|
81
81
|
// per-pipeline-type variables (pipelines.github.runnerVariables);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GithubBackend.js","sourceRoot":"","sources":["../../../../../../../../packages/pipeline/src/backends/github/GithubBackend.ts"],"names":[],"mappings":";;;AAAA,0CAAk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AAqB,CAAC,CAAC;aACxD,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,iBAAM,EAAC,IAAA,WAAI,EAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC,CAAC,CACvD,CAAC;QACF,MAAM,IAAA,aAAE,EAAC,mCAAqB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IACpE,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,MAAc;QAC9B,MAAM,MAAM,GAAG,IAAI,CAAC,gBAAgB,
|
|
1
|
+
{"version":3,"file":"GithubBackend.js","sourceRoot":"","sources":["../../../../../../../../packages/pipeline/src/backends/github/GithubBackend.ts"],"names":[],"mappings":";;;AAAA,0CAAkD;AAClD,+BAA4B;AAC5B,gEAA6D;AAE7D,+CAA2D;AAI3D,+CAA6D;AAC7D,oCAA8C;AAC9C,yDAK4B;AAC5B,oEAAiE;AACjE,uDAAuE;AACvE,2DAAkE;AAClE,uCAAqC;AACrC,2DAG6B;AAC7B,+CAAyE;AAEzE,MAAM,gBAAgB,GAAG,mBAAmB,CAAC;AAE7C;;;GAGG;AACH,MAAM,qBAAqB,GAAG,YAAY,CAAC;AAE3C,MAAM,iBAAiB,GAGnB;IACF,EAAE,EAAE;QACF,IAAI,EAAE,kBAAkB;QACxB,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,CAAC,QAAQ,EAAE,aAAa,EAAE,UAAU,CAAC,EAAE,EAAE;QACtE,WAAW,EAAE;YACX,KAAK,EAAE,6CAA6C;YACpD,oBAAoB,EAAE,IAAI;SAC3B;KACF;IACD,UAAU,EAAE;QACV,IAAI,EAAE,gBAAgB;QACtB,6CAA6C;QAC7C,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE;KACrC;IACD,aAAa,EAAE;QACb,IAAI,EAAE,mBAAmB;QACzB,gEAAgE;QAChE,mE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