[JIRA] (JENKINS-53193) Provide currentBuild.isRestartedRun global variable
Title: Message Title Fernando Nasser created an issue Jenkins / JENKINS-53193 Provide currentBuild.isRestartedRun global variable Issue Type: Improvement Assignee: Unassigned Components: core Created: 2018-08-22 18:54 Priority: Minor Reporter: Fernando Nasser On a restarted stage, there is a when condition, isRestartedRun() that can be used to run or not a stage. But there isn't anything that can be used to execute a bit different on a restart than in the original run. This leads to workarounds like: stages { stage('Schedule') { when { not\{ isRestartedRun() } } agent any steps { myCommand 'isRestartedRun: false' } } stage('Restart') { when { isRestartedRun() } agent any steps { myCommand 'isRestartedRun: true' } } It would be much simpler and clearer to be able to just check for currentBuild.isRestartedRun wherever global variables are accessible Add Comment
[JIRA] (JENKINS-53193) Provide currentBuild.isRestartedRun global variable
Title: Message Title Andrew Bayer assigned an issue to Andrew Bayer Jenkins / JENKINS-53193 Provide currentBuild.isRestartedRun global variable Change By: Andrew Bayer Assignee: Andrew Bayer Add Comment This message was sent by Atlassian JIRA (v7.10.1#710002-sha1:6efc396) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-53193) Provide currentBuild.isRestartedRun global variable
Title: Message Title Andrew Bayer updated an issue Jenkins / JENKINS-53193 Provide currentBuild.isRestartedRun global variable Change By: Andrew Bayer Component/s: pipeline-model-definition-plugin Component/s: core Add Comment This message was sent by Atlassian JIRA (v7.10.1#710002-sha1:6efc396) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-53193) Provide currentBuild.isRestartedRun global variable
Title: Message Title Andrew Bayer commented on JENKINS-53193 Re: Provide currentBuild.isRestartedRun global variable Due to the fun of plugin dependency trees, I can't actually add this to currentBuild, but I could definitely expose this either via a step (though I wouldn't want to call it isRestartedRun() to avoid confusion) or maybe a variable that gets added to the environment automatically. Lemme think on this. Add Comment This message was sent by Atlassian JIRA (v7.10.1#710002-sha1:6efc396) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-53193) Provide currentBuild.isRestartedRun global variable
Title: Message Title Fernando Nasser commented on JENKINS-53193 Re: Provide currentBuild.isRestartedRun global variable Fair enough. Any viable way that achieves the same result is welcome. Add Comment This message was sent by Atlassian JIRA (v7.10.1#710002-sha1:6efc396) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[JIRA] (JENKINS-53193) Provide currentBuild.isRestartedRun global variable
Title: Message Title Fernando Nasser commented on JENKINS-53193 Re: Provide currentBuild.isRestartedRun global variable Maybe this deserves a separate JIRA, but it is certainly related: In a longer pipeline it is possible that one needs to check if a step has been restarted more than one time. Lets say steps 3 and 7 must behave different when they are restarted. If we restart the step 3 the isRestartedRun() will be true and trick step 7 in believing it has been restarted (when it was not, 3 was the one restarted). We need a way to reset this, perhaps after the first step after the restart is completed. Add Comment This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d) -- You received this message because you are subscribed to the Google Groups "Jenkins Issues" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.