Skip to content

dag-deploy ​

Submit a Helm chart to the DAG server and monitor the deployment.

Usage ​

sh
dag-deploy <chart-path> [options]

Arguments ​

ArgumentDescription
<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 ​

OptionEnv VariableDefaultDescription
--server <url>DAG_SERVER_URL—DAG server URL (required)
--repo <url>DAG_REPO_URLauto-detectedOverride the repository URL
--job-id <id>DAG_JOB_IDauto-detectedOverride the CI job ID
--job-token <token>DAG_JOB_TOKENauto-detectedOverride 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):

ValueSource
Repo URLCI_PROJECT_URL
Job IDCI_JOB_ID
Job TokenCI_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.

ValueSource
Repo URLGITHUB_SERVER_URL/GITHUB_REPOSITORY
Job IDGITHUB_RUN_ID
Job TokenGITHUB_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 ​

CodeMeaning
0Deployment succeeded (deployed status)
1Deployment 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).

sh
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.3

TIP

Values set via --set are always strings. Use --set-json for typed values (numbers, booleans, objects, arrays):

sh
--set-json 'resources={"limits":{"cpu":"500m","memory":"256Mi"}}'
--set-json 'replicas=3'

Examples ​

Deploy a chart directory:

sh
dag-deploy ./charts/my-app \
    --server https://dag.example.com \
    --deploy-version v1.2.3

Deploy with values overrides:

sh
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.json

Deploy to a selected environment when multiple DAG environments use the same branch:

sh
dag-deploy ./charts/my-app \
    --server https://dag.example.com \
    --environment production \
    --deploy-version v1.2.3

Deploy a pre-packaged tarball:

sh
dag-deploy my-app-1.2.3.tgz \
    --server https://dag.example.com \
    --deploy-version v1.2.3

Deploy with explicit credentials (outside CI):

sh
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