#20 Default implementation for the execute step should be "shell"
Closed 4 years ago by psss. Opened 4 years ago by psss.

In order to make the shell execution use case (very common) as short as possible I propose to make shell the default for the execute step. In this way the minimal config for executing a shell command could look like this:

/test/build/smoke:
    execute:
        commands:
        - /usr/bin/binary --help

I would not recommend to removing commands attribute as well. It is possible that in the future we would want to provide multiple implementations under a single step which could be done as a list.


So you propose to use script instead of commands, right? The
following would be acceptable variants of the syntax:

/test/build/smoke:
    execute:
        how: shell
        script:
        - first command
        - second command
        - third command

Single command would be supported directly as well:

/test/build/smoke:
    execute:
        how: shell
        script: single command

And finally the how keyword could be omitted:

/test/build/smoke:
    execute:
        script: single command

Does that look ok?

LGTM. Would this be acceptable as well? (I think it should...)

/test/build/smoke:
    execute:
        how: shell
        script: |
          # this is a multi-line script - executor would save it into a script & execute.
          /bin/true
          ls -al /
          exit $?

I like that one as well.

Specification update describing shell as the default execute implementation ready for review. @mvadkert, @happz, please have a look at #23. Thanks.

Metadata Update from @psss:
- Issue assigned to psss

4 years ago

Pull request merged.

Metadata Update from @psss:
- Issue status updated to: Closed (was: Open)

4 years ago

Login to comment on this ticket.

Metadata