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

Remove -e from bash args for build plugins to allow bash runs to continue if something fails #77

Merged
merged 1 commit into from
Nov 1, 2017

Conversation

tizzo
Copy link
Contributor

@tizzo tizzo commented Jun 23, 2016

Problem

Lots of users are running phantomjs or selenium on our infrastructure and there's no good way to do that, run your tests, and kill it again.

Solution

Just don't run bash with -e which exits on the first non-zero exit code. This makes us less like jenkins and means the rest of your script will still try to run after you hit the end but

To test

If you create a job with the following without this PR you'll never see the second echo - with it you should see both echos:

steps:
  - name: Testing
    script: |
      true
      echo "That exited $?"
      false
      echo "That exited $?"

@coveralls
Copy link

coveralls commented Jun 23, 2016

Coverage Status

Coverage remained the same at 26.82% when pulling eb23bad on bash-mode-to-allow-continued-run into ec2b61d on master.

@lliss
Copy link
Contributor

lliss commented Jun 24, 2016

Code looks looks good but I cannot reproduce the original issue. In both master and this PR your shell command returns nothing to my probo output.

I tired it with the following step:

- name: Failure
  plugin: Shell
  command: |
    curl nonsense 
    echo "Nar"

And I get unexpected results. On master and on this PR, it passed
screen shot 2016-06-24 at 7 06 10 am

I've tried this with a variety of commands and am not able to reproduce the original issue.

@tizzo
Copy link
Contributor Author

tizzo commented Aug 30, 2016

What do you mean? It looks like it succesfully ran curl nonsense which exited non-zero and then printed "Nar".

@lliss
Copy link
Contributor

lliss commented Aug 30, 2016

Right. That was without the patch.

@tortillaj tortillaj merged commit 3c4413d into master Nov 1, 2017
@tortillaj tortillaj deleted the bash-mode-to-allow-continued-run branch November 1, 2017 16:58
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 this pull request may close these issues.

4 participants