deploy node
Purpose
Section titled “Purpose”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
Section titled “Config”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"}type: NODEapiKeys: REPLACE_WITH_A_LONG_RANDOM_SECRET: gitlab-cijarFilename: /service/mynode/bundle.zipserviceName: mynodewaitUrl: http://127.0.0.1:3000/healthcurl \ --data-binary @dist.zip \ --fail \ -H "api-key: $DEPLOY_KEY" \ https://dc-agent.example.com/dc-agent/node/mynodePOST /dc-agent/node/{name} — {name} selects the config file; the body is a raw ZIP bundle.
What makes node different
Section titled “What makes node different”- Like
jar, the uploaded file is written tojarFilename— but the body is a ZIP, not a single jar. - After the swap the agent unpacks the ZIP and clears the
appandtargetdirectories so the new bundle is unpacked cleanly. Unpacking is Zip-Slip guarded (see Security).
Parameters
Section titled “Parameters”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 |
Result
Section titled “Result”- 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.