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

added BUILD_RESULT to environment variables #16

Merged
merged 1 commit into from
Dec 1, 2017

Conversation

azweb76
Copy link

@azweb76 azweb76 commented Nov 30, 2017

We have a need to run a post build script for any build status, however we need to perform certain actions if the build is success, failed or any other status. By adding the build result as a BUILD_RESULT environment variable, we can run a single script for all build results and use logic do determine what we action to perform.

if [[ "$BUILD_RESULT" == "SUCCESS" ]]; then
  ./success_script.sh
else
  ./failed_script.sh
fi

@dheid dheid merged commit afd1bec into jenkinsci:master Dec 1, 2017
@dheid
Copy link
Contributor

dheid commented Dec 1, 2017

Good idea! Thanks for your contribution!

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