Skip to content

Instantly share code, notes, and snippets.

@thomaspoignant
Created February 7, 2018 13:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thomaspoignant/7d9e6851b61cf922bdcb79f4bfab927d to your computer and use it in GitHub Desktop.
Save thomaspoignant/7d9e6851b61cf922bdcb79f4bfab927d to your computer and use it in GitHub Desktop.
Detect if pipeline is launch manually or not
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