Created
February 7, 2018 13:40
-
-
Save thomaspoignant/7d9e6851b61cf922bdcb79f4bfab927d to your computer and use it in GitHub Desktop.
Detect if pipeline is launch manually or not
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
script | |
{ | |
//before using this command line you should approve execution on https://jenkins_url/scriptApproval/ | |
launchManually = currentBuild.rawBuild.getCause(hudson.model.Cause$UserIdCause) != null | |
if(launchManually) | |
{ | |
echo "Manually launch" | |
} | |
else | |
{ | |
echo "Automatic launch" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment