Skip to content
This repository was archived by the owner on Jun 6, 2023. It is now read-only.

Commit 139ab54

Browse files
committed
add additional dockerfile command parsing logic to job create
1 parent 53cf7c9 commit 139ab54

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/jobs/create.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,14 @@ function create(params, cb) {
196196
delete params.tail;
197197
}
198198

199-
if (params.useDockerfile && params.buildOnly) {
199+
if (params.useDockerfile && !params.buildOnly && !params.command) {
200+
return ifCliPrintErrorOnly(new Error('Missing required parameter: --command. Use the buildOnly flag or pass a command to execute against the container.'));
201+
} else if (params.useDockerfile && params.buildOnly) {
200202
params.command = null
201-
} else {
203+
} else if (params.command) {
202204
params.command = Buffer.from(params.command).toString('base64');
205+
} else {
206+
return ifCliPrintErrorOnly(new Error('Missing required parameter: --command'));
203207
}
204208

205209
// XXX TODO trim leading/trailing spaces from input paths

0 commit comments

Comments
 (0)