A unified deployment tool for webapp environments, replacing the bash-based deploy.sh script with a Go implementation.
- Deploy to dev, preview, QA, and production environments
- Automatic binary updates
- Cross-platform support (Linux and macOS, both amd64 and arm64)
- Drop-in replacement for existing deploy.sh scripts
Copy this one-liner to your project's deploy script:
#!/usr/bin/env bash
curl -sL https://raw.githubusercontent.com/u2i/compliance-cli/main/scripts/deploy-wrapper.sh | bash -s -- "$@"The wrapper will automatically:
- Download the latest binary on first use
- Cache it locally in
~/.local/bin - Update it daily (or force update with
COMPLIANCE_CLI_FORCE_UPDATE=true)
Download the binary for your platform from the releases page and place it in your PATH.
git clone https://github.com/u2i/compliance-cli.git
cd compliance-cli
make build
make installThe CLI maintains the same interface as the original deploy.sh script:
# Deploy to development
compliance-cli dev
# Deploy preview for PR
compliance-cli preview --pr-number 123
# Deploy to QA
compliance-cli qa
# Promote to production
compliance-cli prod --promote --release qa-abc123The following environment variables are required:
PROJECT_ID- GCP project IDREGION- GCP regionCOMMIT_SHA- Git commit SHASHORT_SHA- Short git commit SHA
These can also be provided as flags:
compliance-cli dev --project-id my-project --region us-central1 --commit-sha abc123 --short-sha abcexport PROJECT_ID=u2i-tenant-webapp-nonprod
export REGION=europe-west1
export COMMIT_SHA=$(git rev-parse HEAD)
export SHORT_SHA=$(git rev-parse --short HEAD)
compliance-cli devcompliance-cli preview --pr-number 123compliance-cli qacompliance-cli prod --promote --release qa-abc123make build # Build for current platform
make release # Build for all platforms
make test # Run tests
make clean # Clean build artifactsThe Docker image is automatically built and published to GitHub Container Registry via GitHub Actions.
- Registry:
ghcr.io/u2i/compliance-cli - Pull command:
docker pull ghcr.io/u2i/compliance-cli:latest
The GitHub workflow (.github/workflows/build-docker-image.yml) automatically triggers when:
- Code is pushed to the
mainbranch - Pull requests are created/updated
- Manually triggered via GitHub Actions UI
Features:
- Builds multi-arch Docker images (linux/amd64, linux/arm64)
- Pushes to GitHub Container Registry (ghcr.io)
- Uses GitHub Actions cache for faster builds
- Tags images with:
latest(for main branch)main(for main branch)pr-<number>(for pull requests)main-<short-sha>(for main branch commits)- Custom tag (when manually triggered)
You can manually trigger a build from the GitHub Actions tab with an optional custom tag.
To build and push to Google Container Registry:
gcloud builds submit --project=u2i-bootstrap --config=cloudbuild.yamlThis creates gcr.io/u2i-bootstrap/compliance-cli-builder images.
-
Tag the release:
git tag -a v1.0.0 -m "Release v1.0.0" git push origin v1.0.0 -
Build release artifacts:
make release
-
Create GitHub release and upload the binaries from
bin/
To migrate from the bash deploy.sh to compliance-cli:
-
Replace the contents of your
scripts/deploy.shwith:#!/usr/bin/env bash curl -sL https://raw.githubusercontent.com/u2i/compliance-cli/main/scripts/deploy-wrapper.sh | bash -s -- "$@"
-
No other changes needed - all existing CI/CD pipelines and scripts will continue to work.
Apache 2.0