GitLab CI¶
Use the Drape CLI in your .gitlab-ci.yml pipeline.
Setup¶
Add DRAPE_API_KEY as a CI/CD variable in your GitLab project settings (Settings > CI/CD > Variables).
Example¶
test:
stage: test
script:
- pytest --junitxml=results.xml --cov --cov-report=xml:coverage.xml
after_script:
- |
curl -sL https://github.com/drape-io/drape-cli/releases/latest/download/drape_linux_amd64.tar.gz | tar xz
chmod +x drape
./drape upload tests results.xml --org my-org --wait
./drape upload coverage coverage.xml --format cobertura --org my-org
artifacts:
reports:
junit: results.xml
Using Docker¶
upload-results:
stage: deploy
image: ghcr.io/drape-io/drape-cli:latest
script:
- drape upload tests results.xml --org my-org --wait
The CLI auto-detects GitLab CI environment variables including branch, SHA, merge request IID, and target branch.