GitHub Actions
Test with Production-Like Data
Restore a snapshot before running your test suite:BASECUT_API_KEY: Your Basecut API keyAWS_ACCESS_KEY_ID: AWS credentials (if snapshot stored in S3)AWS_SECRET_ACCESS_KEY: AWS secret key
Create Snapshot on Schedule
Refresh your dev snapshot weekly with latest production data:Test Schema Migrations
Validate migrations against production-like data before deploying:GitLab CI
Test Pipeline with Snapshot Restore
BASECUT_API_KEY: Your Basecut API key (masked)AWS_ACCESS_KEY_ID: AWS credentials (masked)AWS_SECRET_ACCESS_KEY: AWS secret key (masked, protected)
Scheduled Snapshot Creation
CircleCI
Test Job with Snapshot
BASECUT_API_KEYAWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEY
Jenkins
Declarative Pipeline
basecut-api-key in Jenkins → Manage Credentials.
Docker Compose for CI
For local CI testing or custom CI systems:Best Practices
1. Use Dedicated Test Snapshots
Create separate snapshots for CI with:- Stable sampling: Use
sampling.seedwhensampling.mode: random - Small size: Faster restore (use
limits.rows.per_table) - Stable schema: Update when schema changes, not on every run
2. Cache Basecut CLI Installation
GitHub Actions:3. Handle Restore Failures Gracefully
4. Parallel Test Jobs
Restore snapshot once, run tests in parallel:5. Use Read-Only Database Credentials
Never commit credentials to source control. Use your CI platform’s secret management to storeBASECUT_API_KEY and database credentials. See Agent Deployment for the recommended read-only user setup.
Troubleshooting
Snapshot Restore Too Slow
- Use smaller snapshot: Reduce
limits.rows.per_table - Cache restore: Restore once, reuse DB dump (see parallel tests above)
- Local storage: Use local filesystem for CI snapshots (faster than S3)
Authentication Failures
Database Connection Refused
- Ensure
servicescontainer is healthy before restoring - Check
depends_onwithcondition: service_healthy - Increase
--health-intervalif database starts slowly
Next Steps
Common Workflows
Other patterns for development, debugging, and data sharing
Agent Deployment
Run your own agents for private databases
Environment Variables
Complete CLI configuration reference
Troubleshooting
Debug common CI/CD issues