CI/CD Commands Cheatsheet - CI/CD Pipeline Debugging Reference

When CI hangs in pending or a job fails inexplicably, stop editing the YAML over and over — most clues live in runner status, the failed step's logs, and whether you can reproduce it locally. This table lays out each platform's debugging entry point: rerun failed jobs, capture build logs, check runners and caches. Working through them beats blind config edits.

SysOps·33 commands·Last updated 2026-07-21
cicdgithub-actionsgitlab-cijenkinsrunner

GitHub Actions 6

gh run list --limit 10
List the 10 most recent runs to quickly find failed pipelines
gh run view <run-id> --log-failed
View the failed-step logs for a specific run
gh run rerun <run-id> --failed
Rerun only failed jobs, skipping successful ones
gh run cancel <run-id>
Cancel a running or stuck pipeline
gh workflow run deploy.yml --ref main
Manually trigger a specified workflow
gh api repos/:owner/:repo/actions/runners
Check self-hosted runner online status and labels

GitLab CI 6

gitlab-runner list
List runners registered on this machine
gitlab-runner verify
Verify the runner's connection to GitLab
gitlab-runner run
Start the runner in the foreground to pull jobs (debugging)
gitlab-ci-lint < .gitlab-ci.yml
Validate CI configuration syntax
glab ci list --per-page 20
List recent pipelines with the glab CLI
curl -H "PRIVATE-TOKEN: <token>" "https://gitlab/api/v4/projects/:id/pipelines"
Query pipeline status via the API

Jenkins 5

jenkins-cli build <job> -f -v
Trigger and follow build output (common for CLI debugging)
jenkins-cli console <job> <build>
Fetch the full console log for a build
systemctl status jenkins
Check Jenkins service status (stuck or OOM)
ls -lah /var/lib/jenkins/jobs/<job>/builds/
Inspect disk used by build history
jenkins-cli list-jobs
List all job names before batch scripting

Docker CI Builds 5

docker build -t app:ci --target build .
Multi-stage build targeting a specific stage
docker build --cache-from=app:base .
Speed up builds by reusing cache layers
docker tag app:ci registry/app:$(git rev-parse --short HEAD)
Tag with the short git commit hash
docker buildx build --platform linux/amd64,linux/arm64 .
Multi-arch build and push
docker history app:ci --no-trunc
Inspect each image layer to debug size

Runner & Cache Troubleshooting 5

docker ps --filter "name=runner"
Check if a containerized runner is running
df -h /var/lib/docker
A full CI disk often blocks runners from pulling images or writing logs
act -j <job> -W .github/workflows/ci.yml
Reproduce GitHub Actions locally with act
gitlab-runner exec docker <job>
Reproduce a GitLab CI job locally (older versions)
du -sh ~/.cache/pnpm /root/.cache
Check whether cache dirs are filling the disk

Common Patterns & Best Practices 6

echo "key=value" >> $GITHUB_OUTPUT
Set a step output in GitHub Actions (new syntax)
${{ secrets.NAME }} / $CI_NAME
Reference secrets and CI variables
needs: [build] / depends_on: [test]
Declare job dependencies to control execution order
workflow_dispatch: / schedule: / push:
GitHub Actions trigger configuration
rules: / only: / except:
GitLab CI conditional job execution
artifacts: paths: / expire_in: 1 week
GitLab CI artifact retention and expiry

Tips

  • If a job stays pending, check runner online status and label matching first, then concurrency limits — not by repeatedly editing YAML.
  • When cache hit rate is low, check whether the key uses a lockfile hash and whether the path covers the real dependency directory.
  • CI logs may be retained long-term; never echo secrets or tokens while debugging.
  • Multi-stage Docker builds separate build dependencies from the runtime, greatly shrinking the final image.
  • CI variables come in protected and masked types; always mark sensitive values masked to prevent log leakage.
  • Reproduce CI locally with act (GitHub Actions) or gitlab-runner exec instead of pushing repeatedly.

Official References

Each command links to its official documentation below, so you can verify the latest usage and read deeper.

Maintained by LaoHand

Publicly updated on Jul 21, 2026, continuously proofread against official docs.

Contact Us

Wrong command or description? Send us corrections, business inquiries or product feedback by email.

Contact Us