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

Build Pipeline version could be created after Environment Variables variables were injected

      I'm trying to configure a "Build Pipeline Version" to an ANT JOB.

      All my tests showed the same: the Pipeline Version is created right after the SCM step and BEFORE any other step that allow me to raise a new Environment Variable or execute a shell to read a file to get the version.

      What would be a very good step-by-step option:

      Run SCM
      Run "EnvInject Plugin" plugin (here I can parse a file, run a script, etc, it is very useful)
      Then run the Pipeline Version Creation

      It is so easy to get the POM Version in a "Maven Project" with a "Maven Job", but so painful with a freestyle job.

      If there's a way you have already figured out how to set the Build Pipeline Version using some info coming from files downloaded from SCM step, I'm very interested to learn.

      All examples I have found were about maven jobs and POM's version

      Thank you
      Rafael

          [JENKINS-25483] Build Pipeline version could be created after Environment Variables variables were injected

          Juraj Misur added a comment -

          +1
          In one of the pipeline jobs, we are grabbing artifacts from 2 different jobs, therefore we need to redefine PIPELINE_VERSION based on build numbers of these 2 builds combined.
          For this we would need build step (inserted immediately after our "copy artifacts" steps) which can alter PIPELINE_VERSION (or re/define any variable which would be propagated into downstream pipeline jobs).

          Juraj Misur added a comment - +1 In one of the pipeline jobs, we are grabbing artifacts from 2 different jobs, therefore we need to redefine PIPELINE_VERSION based on build numbers of these 2 builds combined. For this we would need build step (inserted immediately after our "copy artifacts" steps) which can alter PIPELINE_VERSION (or re/define any variable which would be propagated into downstream pipeline jobs).

            Unassigned Unassigned
            rximenes Rafael Ximenes
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: