Thoughts on adding a new array option type. Which would then be an array of one of the existing types.
Given the following example task definition:
run-p:
private: true
usage: Parallel execution helper task
options:
commands:
type: string
required: true
jobs:
type: string
default: 100%
run: |
parallel \
--jobs ${jobs} \
--keep-order \
--line-buffer \
--halt now,fail=1 \
{} ::: ${commands}
And an example of how I am using it:
foo:
usage: Runs some things in parallel
run:
task:
name: run-p
options:
commands: '
"ping -c 4 8.8.8.8"
"ping -c 4 8.8.4.4"
'
While this works and does the job for now, it would be nice if I could supply an array of strings to the task like this:
foo:
usage: Runs some things in parallel
run:
task:
name: run-p
options:
commands:
- ping -c 4 8.8.8.8
- ping -c 4 8.8.4.4
And then an example of what the run-p task definition might look like:
run-p:
private: true
usage: Parallel execution helper task
options:
commands:
type: array
required: true
element-type: string
delimiter: ","
jobs:
type: string
default: 100%
run: |
parallel \
--jobs ${jobs} \
--keep-order \
--line-buffer \
--halt now,fail=1 \
{} ::: \"$(X="${commands}"; echo $${X//,/\" \"})\"
Thoughts on adding a new array option type. Which would then be an array of one of the existing types.
Given the following example task definition:
And an example of how I am using it:
While this works and does the job for now, it would be nice if I could supply an array of strings to the task like this:
And then an example of what the run-p task definition might look like: