Skip to content

[TECH] Change Task execution #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
catks opened this issue Feb 15, 2021 · 1 comment
Open

[TECH] Change Task execution #28

catks opened this issue Feb 15, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@catks
Copy link
Owner

catks commented Feb 15, 2021

Currently, djin transforms any sequence of commands in a single command joined with &&, although it works fine in most cases, there are some caveats that can cause unexpected behavior, for example when running commands with or, eg:

  release:
    local:
      run:
        - command_that_can_fail
        - echo 'I am Here' || echo 'I shouldn’t  be here' 

This will be translated to command_that_can_fail && echo 'I am Here' || echo 'I shouldn’t be here, so if the first command fails will actually execute the echo 'I shouldn’t be here', of course this can be fixed with (), like so:

  release:
    local:
      run:
         - command_that_can_fail
        - (echo 'I am Here' || echo 'I shouldn’t  be here') 

But shouldn't be needed.

An easier approach is to insert () when joining every command, but is also not a good solution as can cause other problems, one good solution is to have a shell session that can be handled like a IO object so he can iterate and send each command capturing the STDOUT and STDERR, but must be implemented to handle local commands, docker and docker-compose interactive shells.

@catks catks added the enhancement New feature or request label Feb 15, 2021
@catks
Copy link
Owner Author

catks commented Feb 19, 2021

https://github.com/ahoward/session seems to be an option rather than using Open3 directly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant