dag-deploy
Submit a Helm chart to the DAG server and monitor the deployment.
Usage
dag-deploy <chart-path> [options]Arguments
| Argument | Description |
|---|---|
<chart-path> | Path to a Helm chart directory, .tgz, or .tar.gz file |
If a directory is provided, it will be packaged into a .tgz tarball automatically.
Options
| Option | Env Variable | Default | Description |
|---|---|---|---|
--server <url> | DAG_SERVER_URL | — | DAG server URL (required) |
--repo <url> | DAG_REPO_URL | auto-detected | Override the repository URL |
--job-id <id> | DAG_JOB_ID | auto-detected | Override the CI job ID |
--job-token <token> | DAG_JOB_TOKEN | auto-detected | Override the CI job token |
--environment <name> | DAG_ENVIRONMENT | — | Target environment name when a branch has multiple environments |
--deploy-version <version> | DAG_DEPLOY_VERSION | — | Deployment version (required) |
--timeout <seconds> | DAG_TIMEOUT | — | Deprecated; accepted and ignored for migration compatibility |
--values-file <path> | — | — | YAML file to deep-merge into the chart's base values.yaml |
--set <key=value> | — | — | Set a dotted path to a literal string value (repeatable) |
--set-json <key=json> | — | — | Set a dotted path to a JSON-parsed value (repeatable) |
--set-file <key=filepath> | — | — | Set a dotted path to the contents of a file (repeatable) |
CI Auto-Detection
When running in a CI environment, dag-deploy automatically detects the repo URL, job ID, and job token from environment variables:
GitLab CI (detected via GITLAB_CI):
| Value | Source |
|---|---|
| Repo URL | CI_PROJECT_URL |
| Job ID | CI_JOB_ID |
| Job Token | CI_JOB_TOKEN |
GitHub Actions (detected via GITHUB_ACTIONS):
WARNING
Server-side GitHub job token verification is not yet implemented. GitHub Actions auto-detection works on the CLI side, but deployments will fail at the server validation step.
| Value | Source |
|---|---|
| Repo URL | GITHUB_SERVER_URL/GITHUB_REPOSITORY |
| Job ID | GITHUB_RUN_ID |
| Job Token | GITHUB_TOKEN or ACTIONS_RUNTIME_TOKEN |
Waiting and Connection Timeouts
The CLI has no total deployment-duration deadline. It waits for DAG's terminal deployed or failed result as long as the server responds. DAG emits a heartbeat every 15 seconds, including periods without rollout progress. Any status, target, or heartbeat event resets the CLI's 30-second inactivity watchdog.
HTTP submission, including its response body, must complete within 30 seconds. Connecting to the event stream and waiting for the next event are also bounded to 30 seconds. A lost or silent stream exits with a connection error and an unknown deployment outcome; it does not mark the server's deployment as failed. Check the deployment in DAG before retrying a submission with an unknown outcome.
Configure rollout budgets on each environment target in DAG. Existing jobs may continue passing --timeout 28800 or DAG_TIMEOUT; these settings print a deprecation warning and apply no deadline.
Exit Codes
| Code | Meaning |
|---|---|
0 | Deployment succeeded (deployed status) |
1 | Deployment failed (failed status or error) |
Values Overrides
dag-deploy can modify the chart's values.yaml before packaging and uploading. When --values-file is provided, the specified YAML file is deep-merged into the chart's base values.yaml — nested objects are merged recursively, while scalars and arrays from the overlay replace the base values. Then --set, --set-json, and --set-file overrides are applied on top.
Values overrides require the chart path to be a directory (not a .tgz).
dag-deploy ./charts/my-app \
--server https://dag.example.com \
--deploy-version v1.2.3 \
--values-file values-production.yaml \
--set image.tag=v1.2.3TIP
Values set via --set are always strings. Use --set-json for typed values (numbers, booleans, objects, arrays):
--set-json 'resources={"limits":{"cpu":"500m","memory":"256Mi"}}'
--set-json 'replicas=3'Examples
Deploy a chart directory:
dag-deploy ./charts/my-app \
--server https://dag.example.com \
--deploy-version v1.2.3Deploy with values overrides:
dag-deploy ./charts/my-app \
--server https://dag.example.com \
--deploy-version v1.2.3 \
--values-file values-staging.yaml \
--set image.tag=$CI_COMMIT_SHA \
--set-json 'replicas=3' \
--set-file config.data=./config.jsonDeploy to a selected environment when multiple DAG environments use the same branch:
dag-deploy ./charts/my-app \
--server https://dag.example.com \
--environment production \
--deploy-version v1.2.3Deploy a pre-packaged tarball:
dag-deploy my-app-1.2.3.tgz \
--server https://dag.example.com \
--deploy-version v1.2.3Deploy with explicit credentials (outside CI):
dag-deploy ./chart \
--server https://dag.example.com \
--deploy-version v1.2.3 \
--repo https://gitlab.com/org/my-app \
--job-id 12345 \
--job-token glcbt-abc123