From 406b424222c38c5277582b2fa59f870627e7e89a Mon Sep 17 00:00:00 2001 From: Dmitry Smirnov Date: Thu, 5 Feb 2026 16:18:42 +0300 Subject: [PATCH] Fix env parsing and bump 3.0.4 --- CHANGELOG.md | 8 ++++++++ deploy.yml | 5 ++++- docs/deploy-config.md | 10 ++++++++-- lib/yaml.js | 2 +- package-lock.json | 4 ++-- package.json | 2 +- src/make/deploy.mk | 4 ++-- 7 files changed, 26 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cb2be9b..56ec91d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ All notable changes to this project will be documented in this file. +## [3.0.4] - 2026-02-05 + +### Fixed + +- Fix YAML key listing to output real newlines so env vars are passed correctly. +- Quote command display in deploy make target to avoid shell parse errors. +- Update default deploy config and docs to use `command` + `args`. + ## [3.0.3] - 2026-02-05 ### Changed diff --git a/deploy.yml b/deploy.yml index e783026..b7ad8f0 100644 --- a/deploy.yml +++ b/deploy.yml @@ -4,4 +4,7 @@ config: image: "worker-nodejs:latest" env: NODE_ENV: "production" - command: "node -e \\\"console.log('hello_world')\\\"" + command: "node" + args: + - "-e" + - "console.log('hello_world')" diff --git a/docs/deploy-config.md b/docs/deploy-config.md index c97fd31..59073e7 100644 --- a/docs/deploy-config.md +++ b/docs/deploy-config.md @@ -11,7 +11,10 @@ config: - "./:/workspace" env: DEBUG: "true" - command: "worker run my-task" + command: "worker" + args: + - "run" + - "my-task" ``` Using container default command: @@ -44,5 +47,8 @@ config: email: "worker-sa@my-project.iam.gserviceaccount.com" volumes: - "./:/workspace" - command: "worker deploy --env=staging" + command: "worker" + args: + - "deploy" + - "--env=staging" ``` diff --git a/lib/yaml.js b/lib/yaml.js index a76ea18..250ab3d 100755 --- a/lib/yaml.js +++ b/lib/yaml.js @@ -82,7 +82,7 @@ if (cmd === "length") { if (cmd === "keys") { if (value && typeof value === "object" && !Array.isArray(value)) { - Object.keys(value).forEach((k) => process.stdout.write(`${k}\\n`)); + Object.keys(value).forEach((k) => process.stdout.write(`${k}\n`)); } process.exit(0); } diff --git a/package-lock.json b/package-lock.json index 8f545ba..aeff46e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@udx/worker-deployment", - "version": "3.0.0", + "version": "3.0.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@udx/worker-deployment", - "version": "3.0.0", + "version": "3.0.4", "license": "MIT", "os": [ "darwin", diff --git a/package.json b/package.json index 0893b2e..d094293 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@udx/worker-deployment", - "version": "3.0.3", + "version": "3.0.4", "description": "Docker container runner with YAML configuration and automatic GCP authentication (keys, Workload Identity, impersonation)", "bin": { "worker": "bin/worker" diff --git a/src/make/deploy.mk b/src/make/deploy.mk index b2eb6d7..78d2931 100644 --- a/src/make/deploy.mk +++ b/src/make/deploy.mk @@ -48,7 +48,7 @@ run: @echo $(CRED_INFO) @echo "Image: $(WORKER_IMAGE)" ifneq ($(COMMAND),) - @echo Command: $(COMMAND) + @printf '%s\n' 'Command: $(call squote,$(COMMAND))' else @echo "Command: " endif @@ -101,7 +101,7 @@ run-it: @echo $(CRED_INFO) @echo "Image: $(WORKER_IMAGE)" ifneq ($(COMMAND),) - @echo Command: $(COMMAND) + @printf '%s\n' 'Command: $(call squote,$(COMMAND))' else @echo "Command: " endif