CI/CD Integration
DevKit is designed to be CI/CD native with structured exit codes, JSON output, and concurrency-safe registry locking.
Exit Codes
| Code | Meaning | CI Action |
|---|---|---|
0 | Success — deployed and activated | Continue pipeline |
10 | Pending approval — proposal created | Wait / notify |
11 | Rejected — proposal was denied | Fail pipeline |
12 | Policy violation — blocked by policy | Fail pipeline |
13 | Registry error — storage issue | Retry |
14 | Platform API error | Retry |
15 | Router activation error | Investigate |
GitHub Actions
name: Deploy Schema
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install DevKit
run: curl -fsSL https://releases.hyperroute.dev/devkit/install.sh | bash
- name: Push Schema
env:
HYPERROUTE_API_KEY: ${{ secrets.HYPERROUTE_API_KEY }}
run: |
hyperroute push \
--env production \
--name ${{ github.event.repository.name }} \
--schema dist/schema.graphql \
--url ${{ vars.SERVICE_URL }} \
--json
- name: Handle approval
if: ${{ failure() }}
run: |
EXIT_CODE=$?
if [ "$EXIT_CODE" = "10" ]; then
echo "::warning::Schema change requires approval"
fi
GitLab CI
deploy-schema:
stage: deploy
script:
- curl -fsSL https://releases.hyperroute.dev/devkit/install.sh | bash
- hyperroute push
--env production
--name ${CI_PROJECT_NAME}
--schema dist/schema.graphql
--url ${SERVICE_URL}
--json
allow_failure:
exit_codes:
- 10 # Pending approval
Generic CI Script
#!/bin/bash
set -e
# Install DevKit
curl -fsSL https://releases.hyperroute.dev/devkit/install.sh | bash
# Push schema and capture exit code
set +e
hyperroute push --env production \
--name products \
--schema dist/schema.graphql \
--url http://products:4001/graphql \
--json
EXIT_CODE=$?
set -e
case $EXIT_CODE in
0) echo "✅ Deployed successfully" ;;
10) echo "⏳ Awaiting approval — check Platform UI" ;;
11) echo "❌ Rejected" && exit 1 ;;
12) echo "❌ Policy violation" && exit 1 ;;
*) echo "❌ Error (code $EXIT_CODE)" && exit 1 ;;
esac
Tips
- Use
--jsonfor machine-parseable output in CI - Use
--waitto block the pipeline until approval resolves - Use
--timeoutto set a maximum wait time - Use
--git-shaand--git-branchfor traceability (auto-detected from git if not provided) - Set
HYPERROUTE_API_KEYas a secret in your CI platform