Skip to content
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

Fail at errors in multiline-commands #3443

Open
alexgit2k opened this issue Jan 13, 2023 · 0 comments · May be fixed by #3444
Open

Fail at errors in multiline-commands #3443

alexgit2k opened this issue Jan 13, 2023 · 0 comments · May be fixed by #3444

Comments

@alexgit2k
Copy link
Contributor

If there is an error in a multiline command, deployer will not fail like bash-scripts do not fail unless the option "set -e -o pipefail" is used:

Example:

hosts:
  test:
    local: true

tasks:
  singleFail:
    - run: 'echo "Start"'
    - run: 'false'
    - run: 'echo "End"'
  multiNoFail:
    - run: |
        echo "Start"
        false
        echo "End 1"
  multiFail:
    - run: |
        set -e -o pipefail
        echo "Start"
        false
        echo "End 1"

dep -v single fails, because commands are executed one by one
dep -v multiNoFail does not fail, because errors in multiline scripts are ignored
dep -v multiFail fails, because with set it fails at any error

I would suggest to automatically add the set when there is a multiline command.

@alexgit2k alexgit2k linked a pull request Jan 13, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant