Reproduzierbare Build-Artefakte
Macht Release-Pakete reproduzierbar und nachvollziehbar durch kontrollierte Eingaben, Inhalte sowie getrennte Konfiguration und Geheimnisse.
build-artifact-management
Entdecke, wie der Skill hilftWann ist der Skill hilfreich?
Nutze dies, wenn derselbe Quellstand ein nachvollziehbares, wiederverwendbares Release-Paket ergeben muss.
Wobei hilft er dir?
- Fixiert Werkzeuge und Abhängigkeiten und weist unerwartete Lockfileänderungen zurück.
- Trennt Build-Eingaben, Laufzeitkonfiguration und Geheimnisse im ausgelieferten Artefakt.
- Bindet Caches an tatsächliche Eingaben und prüft Paketinhalt und Herkunft.
Das könntest du fragen
Prüfe unseren Containerbuild auf offengelegte Konfiguration, wechselnde Abhängigkeiten und Reproduzierbarkeit zwischen CI-Runnern. Baue dieselbe Revision auf zwei sauberen Runnern und prüfe die Paketdateien. Erkläre Digest-Unterschiede und verhindere Produktionszugangsdaten in Image-Schichten.
Ausführliche Dokumentation
Hier findest du die ursprüngliche Anleitung, Beispiele und Prüfschritte des Skills in ihrer Originalsprache.
Weniger anzeigen
Build & Artifact Management
A reliable release pipeline guarantees that given the same commit SHA, lockfile, and toolchain versions, the build produces a predictable, verifiable artifact free of local machine state or baked-in environment secrets.
Pinning All Build Inputs
Eliminate "works on my runner, breaks next week" drift by pinning every layer of the build environment:
- Toolchain & OS base versions:
- Pin Node/Python/Go/PHP/Java/Rust versions explicitly in both local version files (
.nvmrc,.node-version,rust-toolchain.toml,package.json#engines) and CI/Dockerfile base images (node:22.14.0-bookworm-slim@sha256:...rather than floatingnode:latest).
- Pin Node/Python/Go/PHP/Java/Rust versions explicitly in both local version files (
- Frozen dependency installation:
- Always install dependencies in CI and container builds using frozen lockfile flags (
npm ci,pnpm install --frozen-lockfile,yarn install --immutable,composer install --no-interaction --no-progress --prefer-dist,cargo build --locked). - If the lockfile is out of sync with the manifest, fail the build immediately rather than silently resolving newer transitive versions during a release.
- Always install dependencies in CI and container builds using frozen lockfile flags (
- Separate build-time vs. runtime dependencies:
- Prune devDependencies or use multi-stage builds so compilers, test runners, and local CLI tools do not bloat the shipped runtime artifact or widen its vulnerability surface.
Strict Separation of Build, Config & Secrets
- Never bake environment-specific secrets or URLs into a shared artifact:
- Server-side applications must read environment configuration and secrets at runtime startup (and validate them immediately with a strict schema check on boot).
- For static/SPA frontend bundles where
VITE_*/NEXT_PUBLIC_*variables are inlined at build time, never pass private keys into public env vars, and either inject runtime configuration via a small non-cached/config.json/ HTML meta payload or explicitly document per-environment bundle builds.
- Verify
.dockerignoreand package allowlists (filesinpackage.json):- Exclude
.git,.env*,node_modules, test fixtures, coverage reports, and local build caches from build contexts so local secrets or gigabytes of junk never enter an image layer or tarball.
- Exclude
Cache Discipline: Speed Without Corruption
CI and Docker layer caches exist only to accelerate reproducible steps—never to mask missing build inputs:
- Bind cache keys to exact input hashes: Key dependency caches by
OS + arch + runtime_version + hashFiles('<lockfile>'). Key build caches (e.g., Turbo/Nx/Vite/Gradle/Cargo) by source + config + lockfile hashes. - Order Dockerfile layers from least-frequently changed to most-frequently changed: Copy only
package.json+ lockfile and runnpm cibeforeCOPY src/ ./so source code edits do not invalidate the dependency installation layer. - Immutable artifact identification: Tag every built artifact with both its semantic/release version and its immutable git SHA (
app:1.4.2,app:sha-9f8a7b6), and record the registry digest (sha256:...) in the release log.
Enthaltene Dateien 1
SKILL.md
