Skip to content

deploy node

Deploy a Node.js application shipped as a ZIP bundle. The agent stops the service, replaces the bundle, unpacks it, restarts under daemontools, and polls a health URL. Shares its lifecycle and most parameters with war and jar — the full table is in the parameter reference.

config/mynode.json:

config/mynode.json
{
"type": "NODE",
"apiKeys": {
"REPLACE_WITH_A_LONG_RANDOM_SECRET": "gitlab-ci"
},
"jarFilename": "/service/mynode/bundle.zip",
"serviceName": "mynode",
"waitUrl": "http://127.0.0.1:3000/health"
}
.gitlab-ci.yml job
curl \
--data-binary @dist.zip \
--fail \
-H "api-key: $DEPLOY_KEY" \
https://dc-agent.example.com/dc-agent/node/mynode

POST /dc-agent/node/{name} — {name} selects the config file; the body is a raw ZIP bundle.

  • Like jar, the uploaded file is written to jarFilename — but the body is a ZIP, not a single jar.
  • After the swap the agent unpacks the ZIP and clears the app and target directories so the new bundle is unpacked cleanly. Unpacking is Zip-Slip guarded (see Security).

The full table (defaults verified against the source) lives in the parameter reference. The essentials:

Name Description Default Required
jarFilename Destination path for the uploaded ZIP bundle — yes
serviceName daemontools service name; derives serviceDir and serviceLogFile — yes
waitUrl Health URL polled after restart; must return 200 — (skipped if unset) no
  • Success returns HTTP 200 with the last 10 lines of the service log.
  • If the service does not come back or the health URL never returns 200 within waitDuration, the response is HTTP 417 with the last 50 log lines.