leopardslab / dunner

Dunner is a task runner tool like Grunt but used Docker images like CircleCI do. You can define tasks and steps of the tasks in your `.dunner.yaml` file and then run these steps with `Dunner do taskname`
MIT License
66 stars 41 forks source link

Ability to pass varying number of parameters to a command #205

Open agentmilindu opened 4 years ago

agentmilindu commented 4 years ago

Is your feature request related to a problem? Please describe. Tools like Maven, Yarn, etc need the ability to pass varying number of multiple parameters. For example,

mvn clean build
mvn package 
mvn clean dependency:copy-dependencies package
mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.4 -DinteractiveMode=false

but currently, in Dunner, we have to define how many params we are expecting in .dunner.yaml like,

...
  mvn:
    steps:
      - image: 'maven'
        commands:
          # This uses args passed to the task, `$1` means first arg
          - ['mvn', ' $1']
...

With the above definition we can only pass one parameter. like dunner do mvn package and commands as mvn clean build would fail.

Describe the solution you'd like We need a way to hint Dunner to let users pass as many params as they wish, like in Java ellipsis.

Proposing syntax is as below
...
  mvn:
    steps:
      - image: 'maven'
        commands:
          # This uses args passed to the task, `$1` means first arg
          - ['mvn', ' $...']
...