CI/CD Integration¶
The Versioner CLI automatically detects your CI/CD environment and extracts relevant metadata, reducing the number of flags you need to specify.
Supported Systems¶
The CLI supports auto-detection for 8 CI/CD systems:
How Auto-Detection Works¶
When you run the CLI in a supported CI/CD system:
- System Detection - CLI checks environment variables to identify the system
- Metadata Extraction - Automatically populates fields like repository, SHA, build number, user
- Override Support - You can always override auto-detected values with flags
See what's auto-detected
Use --verbose to see which values were auto-detected:
Auto-Detection Comparison¶
| System | Repository | Git SHA | Branch | Build # | Build URL | User | |
|---|---|---|---|---|---|---|---|
| GitHub Actions | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ |
| GitLab CI | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| Jenkins | ✅ | ✅ | ✅ | ✅ | ✅ | ⚠️* | ⚠️* |
| CircleCI | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ |
| Bitbucket | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ |
| Azure DevOps | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| Travis CI | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ |
| Rundeck | ❌ | ❌ | ❌ | ✅ | ✅ | ✅ | ❌ |
* Requires Build User Vars Plugin
Installation in CI/CD¶
All examples include CLI download steps. The CLI is a single binary with no dependencies.
Latest version:
curl -L https://github.com/versioner-io/versioner-cli/releases/latest/download/versioner-linux-amd64 -o /usr/local/bin/versioner
chmod +x /usr/local/bin/versioner
Specific version (recommended for production):
VERSION=v1.0.3
curl -L https://github.com/versioner-io/versioner-cli/releases/download/${VERSION}/versioner-linux-amd64 -o /usr/local/bin/versioner
chmod +x /usr/local/bin/versioner
Configuration Priority¶
When the CLI determines field values, it uses this priority order:
- CLI Flags (highest priority) -
--version=1.2.3 - Environment Variables -
VERSIONER_VERSION=1.2.3 - CI/CD Auto-Detection - Extracted from CI system
- Defaults (lowest priority)
Example:
# Auto-detected SHA is abc123, but you want to use a different version
versioner track deployment \
--product=my-api \
--environment=production \
--version=1.2.3 \
--status=completed
# Uses version "1.2.3" instead of auto-detected SHA
Quick Examples¶
Track a Build¶
# Most fields auto-detected from CI environment
versioner track build \
--product my-api \
--status completed
Track a Deployment¶
# Most fields auto-detected from CI environment
versioner track deployment \
--product my-api \
--environment production \
--status completed
Next Steps¶
Choose your CI/CD system to see detailed integration examples: