Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-58795

Jenkins pipeline - Getting information When Restart Stage

    Details

    • Similar Issues:

      Description

      When restarting a stage, in the console the follwoing output is shown

      Restarted from build #4, stage foobar

      Is there any way to access this information within the restarted build? Eg via ENV variables or globals in the Jenkinsfile?

        Attachments

          Activity

          Hide
          ahmeditman Ahmed Itman added a comment -

          I made an work around using groovy Regular Expressions - regexes to grep build logs, looking for " Restarted from build #\d "
          If i found it, it means that build is restarted and if not that's mean it is a new build not depending on another build 
          Is their another solution ? 
          because i think my solution is not the best and may be standard of logs will be changed in the future 

          Show
          ahmeditman Ahmed Itman added a comment - I made an work around using groovy Regular Expressions - regexes to grep build logs, looking for " Restarted from build #\d " If i found it, it means that build is restarted and if not that's mean it is a new build not depending on another build  Is their another solution ?  because i think my solution is not the best and may be standard of logs will be changed in the future 

            People

            • Assignee:
              abayer Andrew Bayer
              Reporter:
              ahmeditman Ahmed Itman
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: