Skip to content

Commit

Permalink
fix(config): allow empty strings in commands and args
Browse files Browse the repository at this point in the history
  • Loading branch information
edvald committed Aug 13, 2020
1 parent a5ad44a commit 5a9228b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
12 changes: 6 additions & 6 deletions core/src/plugins/container/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -371,12 +371,12 @@ const containerServiceSchema = () =>
),
command: joi
.array()
.items(joi.string())
.items(joi.string().allow(""))
.description("The command/entrypoint to run the container with when starting the service.")
.example(commandExample),
args: joi
.array()
.items(joi.string())
.items(joi.string().allow(""))
.description("The arguments to run the container with when starting the service.")
.example(["npm", "start"]),
daemon: joi.boolean().default(false).description(deline`
Expand Down Expand Up @@ -496,13 +496,13 @@ export const containerTestSchema = () =>
baseTestSpecSchema().keys({
args: joi
.array()
.items(joi.string())
.items(joi.string().allow(""))
.description("The arguments used to run the test inside the container.")
.example(["npm", "test"]),
artifacts: artifactsSchema(),
command: joi
.array()
.items(joi.string())
.items(joi.string().allow(""))
.description("The command/entrypoint used to run the test inside the container.")
.example(commandExample),
env: containerEnvVarsSchema(),
Expand All @@ -523,14 +523,14 @@ export const containerTaskSchema = () =>
.keys({
args: joi
.array()
.items(joi.string())
.items(joi.string().allow(""))
.description("The arguments used to run the task inside the container.")
.example(["rake", "db:migrate"]),
artifacts: artifactsSchema(),
cacheResult: cacheResultSchema(),
command: joi
.array()
.items(joi.string())
.items(joi.string().allow(""))
.description("The command/entrypoint used to run the task inside the container.")
.example(commandExample),
env: containerEnvVarsSchema(),
Expand Down
4 changes: 2 additions & 2 deletions core/src/plugins/exec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const execTestSchema = () =>
.keys({
command: joi
.array()
.items(joi.string())
.items(joi.string().allow(""))
.description(
dedent`
The command to run to test the module.
Expand All @@ -93,7 +93,7 @@ export const execTaskSpecSchema = () =>
artifacts: artifactsSchema().description("A list of artifacts to copy after the task run."),
command: joi
.array()
.items(joi.string())
.items(joi.string().allow(""))
.description(
dedent`
The command to run.
Expand Down
8 changes: 4 additions & 4 deletions core/src/plugins/kubernetes/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -640,12 +640,12 @@ export const kubernetesTaskSchema = () =>
cacheResult: cacheResultSchema(),
command: joi
.array()
.items(joi.string())
.items(joi.string().allow(""))
.description("The command/entrypoint used to run the task inside the container.")
.example(commandExample),
args: joi
.array()
.items(joi.string())
.items(joi.string().allow(""))
.description("The arguments to pass to the container used for execution.")
.example(["rake", "db:migrate"]),
env: containerEnvVarsSchema(),
Expand All @@ -665,12 +665,12 @@ export const kubernetesTestSchema = () =>
),
command: joi
.array()
.items(joi.string())
.items(joi.string().allow(""))
.description("The command/entrypoint used to run the test inside the container.")
.example(commandExample),
args: joi
.array()
.items(joi.string())
.items(joi.string().allow(""))
.description("The arguments to pass to the container used for testing.")
.example(["npm", "test"]),
env: containerEnvVarsSchema(),
Expand Down
2 changes: 1 addition & 1 deletion core/src/types/plugin/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export const runResultSchema = () =>
moduleName: joi.string().description("The name of the module that was run."),
command: joi
.array()
.items(joi.string())
.items(joi.string().allow(""))
.required()
.description("The command that was run in the module."),
version: joi.string().description("The string version of the module."),
Expand Down
2 changes: 1 addition & 1 deletion core/src/types/plugin/task/getTaskResult.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const taskResultSchema = () =>
taskName: joi.string().description("The name of the task that was run."),
command: joi
.array()
.items(joi.string())
.items(joi.string().allow(""))
.required()
.description("The command that the task ran in the module."),
version: joi.string().description("The string version of the task."),
Expand Down

0 comments on commit 5a9228b

Please sign in to comment.