Checking and running a pipeline locally #
Two commands answer "what will my .gitlab-ci.yml do?" before you push:
shuttle lint [path]checks it without a runner, using the same expansion code Shuttle uses for real pipelines.shuttle run-local [path]runs it on a real GitLab Runner, without a knot, an OAuth session, or a PDS.
path defaults to the current directory. Start with lint; run-local
performs the same check first and stops on the same problems.
Simulated push #
Both commands simulate a push and accept the same flags:
--ref: simulated git ref (default: current branchrefs/heads/<branch>or tag pointing at HEADrefs/tags/<tag>).--default-branch: default branch (default: fromrefs/remotes/origin/HEAD, elsemain).--sha: commit SHA (default:HEAD).--before: before commit SHA.--changed <path>: changed file path (repeatable; default: diff between merge-base with@{upstream}(elseHEAD~1) andHEAD).--var <KEY=VALUE>: predefined CI variable override (repeatable).--worktree: read files from the working tree instead of the tree at the chosen SHA.
Outside a git repository, defaults are omitted and only explicitly passed flags apply; rules requiring a ref are reported as not evaluable without --ref.
shuttle lint #
shuttle lint [path]
--json prints machine-readable JSON instead of text.
Exit codes:
0: runnable (partially implemented features accepted without effect or Shuttle extensions are reported as notes).1: hard blockers (keywords Shuttle does not implement).2: errors (YAML syntax errors, undeclared stages, cycles, broken extends/references/includes).
shuttle run-local #
shuttle run-local [path]
shuttle run-local --runner docker --worktree .
A blocker or lint error is printed in lint's text format and stops before a runner or HTTP server starts.
The command starts an in-process coordinator backed by SQLite in memory and
serves only the selected repository through Git smart HTTP. It never discovers
a knot, opens an OAuth session, or contacts a PDS. --worktree uses an
unreferenced git stash create object, without changing the worktree, index, or
refs.
Additional flags are:
--runner binary|docker(defaultbinary). Binary mode runsgitlab-runner run-singlefromPATH;--runner-binoverrides its path. Docker mode runs the official runner image pinned to the digest indocker-compose.ymland mounts the Docker socket.--docker-imagesets the default job image. It defaults to the official Alpine image pinned by digest used by the end-to-end tests.--listensets the server listen address; the default is a random free port.--wait-timeoutsets the runner's first-job fallback timeout (default 30 seconds). The runner's--max-buildsis the sum of1 + retry:maxover all jobs. Shuttle stops it with SIGQUIT, then SIGTERM after a grace period, as soon as the pipeline is terminal.--outselects the output directory. The default is.shuttle/run/<UTC timestamp>/.--runner-tags a,bsets the local runner's tags. The default is the sorted union of every job's tags.run_untaggedis true when any job has no tags, including when--runner-tagsis set, so an untagged job still runs beside tagged ones. The runner process is not given those tags; Shuttle stores them with the throwaway token and only hands a job to a runner whose tags include every job tag. A job no runner can take stays pending. When the runner process exits, the summary records why and the command exits 1.
The output directory contains one sanitized <job>.log per attempt (later
attempts have -<attempt> appended) and summary.json with stage, status, exit
code, attempt, duration, coverage, and failure reason.
Exit codes:
0: successful pipeline, including allowed failures.1: failed pipeline.2: lint or infrastructure errors.
On Linux, containers do not interpret host loopback as the host. Docker mode
therefore listens on all host interfaces on its random port, gives the runner
container host.docker.internal:host-gateway, and passes the same mapping to
job and helper containers with --docker-extra-hosts. The API has only a
throwaway in-memory runner token, and the Git handler is read-only and exports
only the temporary bare repository for this invocation.