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

Content of BUILD_ID environment variable changed from timestamp to build number

    Details

    • Similar Issues:

      Description

      With ticket JENKINS-24380, the BUILD_ID was changed from timestamp to the build number in version 1.597:

      Stop using the formatted timestamp to compute Run.id, and just use the build number as the directory name, so that

      This change affected the content of the environment variable BUILD_ID too, becoming equal to the content of BUILD_NUMBER. I used the BUILD_ID variable in my jobs to detect the time, the current build was started. Now I can not do this anymore. Please consider to introduce another variable that will transport the earlier content of BUILD_ID. E.g. create a new environment variable called "BUILD_TIMESTAMP".
      So long, I use the EnvInject plugin together with this Groovy script as a workaround:

      return [BUILD_TIMESTAMP:currentBuild.getTime().format("yyyy-MM-dd_HH-mm-ss")]

      The change makes it also necessary to fix the content of the "env-vars.html" file (help link below a Windows Batch Command entry). Description of BUILD_ID must be changed and BUILD_TIMESTAMP must be added.

      The zentimestamp plugin will become invalid after this change. It must be changed to affect the content of the variable BUILD_TIMESTAMP variable.

        Attachments

          Issue Links

            Activity

            Hide
            fpoulet Poulet Fabrice added a comment -

            I don't undertand why this issue is considered as duplicate/Resolve.
            I undestand that the content of the variable BUILD_ID was not appropriate, but the timestamp was very usefull.
            What's about a new variable BUILD_TIMESTAMP ?
            It is very anoying, since build 1.597 we can't upgrade jenkins because of this.

            Regards

            Show
            fpoulet Poulet Fabrice added a comment - I don't undertand why this issue is considered as duplicate/Resolve. I undestand that the content of the variable BUILD_ID was not appropriate, but the timestamp was very usefull. What's about a new variable BUILD_TIMESTAMP ? It is very anoying, since build 1.597 we can't upgrade jenkins because of this. Regards
            Hide
            martin_rust Martin Rust added a comment -

            Hi Poulet Fabrice, follow & post at JENKINS-26520

            Show
            martin_rust Martin Rust added a comment - Hi Poulet Fabrice, follow & post at JENKINS-26520

              People

              • Assignee:
                Unassigned
                Reporter:
                mre_mchp Michael Rentschler
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: