Skip to content

Exit batch script with error if docker commands fail#428

Merged
nuclearsandwich merged 1 commit intomasterfrom
brawner/exit_on_failure
Apr 14, 2020
Merged

Exit batch script with error if docker commands fail#428
nuclearsandwich merged 1 commit intomasterfrom
brawner/exit_on_failure

Conversation

@brawner
Copy link
Contributor

@brawner brawner commented Apr 10, 2020

If commands fail in a batch script, it tends to continue without failing. Unfortunately, there is not a cmd equivalent of set -e so it's common to use the || exit /b %errorlevel% paradigm used below. I'm adding it to just the commands that are likely to fail in this script.

Depends on #427
New commit: d00fbb7

@brawner brawner self-assigned this Apr 10, 2020
Copy link
Member

@cottsay cottsay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build Status

@nuclearsandwich
Copy link
Member

@brawner there's a conflict that needs to be resolved. If you give me the 👌 I'll do a dry run to make sure this PR doesn't introduce a deploy error then merge and deploy it this afternoon.

@brawner brawner force-pushed the brawner/exit_on_failure branch from d00fbb7 to 3dee491 Compare April 14, 2020 20:28
@nuclearsandwich
Copy link
Member

@cottsay since this PR touches the job templates only I'm not sure that your CI job exercised it at all. Am I missing something?

@cottsay
Copy link
Member

cottsay commented Apr 14, 2020

You're correct - I was mistaken.

Copy link
Member

@nuclearsandwich nuclearsandwich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works when dry-run locally.

@nuclearsandwich nuclearsandwich merged commit bb8cfb3 into master Apr 14, 2020
@nuclearsandwich nuclearsandwich deleted the brawner/exit_on_failure branch April 14, 2020 21:45
@nuclearsandwich
Copy link
Member

Deployed

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.

3 participants