Use Cirrus CLI to run Dockerized tasks locally or in any CI
masterCirrus CLI is an open-source, CI-agnostic tool that allows you to run isolated tasks in any environment where Docker is installed. It uses the Cirrus configuration format (.cirrus.yml) to execute tasks inside Docker containers, ensuring that the environment used locally on a developer's machine is identical to the environment used in a remote CI provider.
Key benefits include:
- Environment Parity: Run the exact same tasks locally as in CI to eliminate "works on my machine" issues.
- Isolation: All tasks execute in isolated Docker containers for stability.
- Caching: Supports local disk caching or HTTP-based remote caching.
- Portability: Use the same configuration across different CI vendors or run it manually via the CLI.
task:
env:
matrix:
VERSION: 1.15
VERSION: 1.14
name: Tests (Go $VERSION)
container:
image: golang:$VERSION # official Go Docker image
modules_cache:
folder: $GOPATH/pkg/mod
fingerprint_script: cat go.sum
get_script: go get ./...
build_script: go build ./...
test_script: go test ./...