← ClaudeAtlas

validating-ci-pipelines-locallylisted

Single source of truth for executing GitLab CI/CD pipelines locally with the same image, env vars, and service containers as the real runner — so pipeline failures are caught before push. Defines pipeline discovery (.gitlab-ci.yml + includes), per-job execution via gitlab-runner exec, service-container orchestration (Mongo, Redis, MailHog), env injection without secrets, cache/artifact handling, and a job-by-job verdict report. Also describes the GitHub Actions equivalent via act for projects that mirror to GitHub. Activates whenever an agent or command needs to validate that the CI pipeline will pass — currently used by /lt-dev:production-ready and lt-dev:production-readiness-orchestrator. NOT for running the local check script (use running-check-script). NOT for writing or refactoring CI configs (use the devops agent).
lenneTech/claude-code · ★ 0 · DevOps & Infrastructure · score 75
Install: claude install-skill lenneTech/claude-code
# Validating CI Pipelines Locally This skill is the **single source of truth** for reproducing a GitLab (or GitHub Actions) pipeline locally. The goal is to catch pipeline failures **before** pushing to the remote — using the same Docker image, the same env vars, and the same service containers as the real runner. > **Goal:** Run every job from `.gitlab-ci.yml` (or `.github/workflows/*.yml`) on the local machine with results that mirror what the remote runner would produce. ## When to Use This Skill | Caller | Phase | Trigger | |--------|-------|---------| | `/lt-dev:production-ready` | Phase 7 | Hard release gate — must pass before sign-off | | `lt-dev:production-readiness-orchestrator` | Phase 7 | Owns the per-job execution + retry loop | | Manual user invocation | Pre-push | Reproducing a CI failure locally without the round-trip | ## Step 1 — Detect the pipeline format The repo may use GitLab, GitHub Actions, or both. Detect first: ```bash # GitLab test -f .gitlab-ci.yml && echo "gitlab" || true ls .gitlab-ci/*.yml 2>/dev/null # included files # GitHub Actions ls .github/workflows/*.yml 2>/dev/null ``` If multiple formats exist, the consumer asks the user which to validate. If `--ci=<gitlab|github|both>` was passed, honour it. ## Step 2 — Ensure the runner toolchain is installed | Format | Tool | Install (macOS) | Install (Linux) | Image-only fallback | |--------|------|-----------------|------------------|----------------------| | GitLab | `gitlab-runner` |