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

Injected Jenkins build env variables not resolved/forwarded

      In Jenkins, in a Maven build project, I have a pre build step that executes a shell command with a pre build step of type "Execute shell". In this shell script, I fill a properties file with values:
      echo values=1,2,3 > data.properties.

      As the "Post-build Actions", I deploy artifacts to
      Artifactory. Although I check "Include all environment variables", my
      environment variable is not listed in Artifactory's "Environment" panel
      for builds. In Jenkins, I've also added the environment variable in
      "Deployment properties" under the section "Deploy maven artifacts". But in
      Artifactory, the variable was not resolved in the Repository Browser >
      "Metadata" of the deployed artifact.

      Solely defining the values and properties in the "build environment" section does not work, because the properties file is filled during build time.

      From JFrog/Artifactory I got the answer:
      "Our plugin has an extension point which gathers all the environment variables and passing them through to our extractors (Maven/Gradle/Ivy).
      This procedure happens before the EnvInject plugin, I'm afraid we cannot change this behavior since the order is out of our control."

      How can I pass my generated values along to the post build step, or more generally asking: is there any way to compute values during build time inside a shell skript and pass them along as environment variables to the post build action that deploys the artifacts to Artifactory?

      The attached screenshots were created by the Artifactory team.

      Thanks!

          [JENKINS-15112] Injected Jenkins build env variables not resolved/forwarded

          Michael Hüttermann created issue -
          Gregory Boissinot made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 145832 ] New: JNJira + In-Review [ 185425 ]
          Oleg Nenashev made changes -
          Status Original: In Progress [ 3 ] New: Open [ 1 ]
          Oleg Nenashev made changes -
          Component/s New: artifactory-plugin [ 15689 ]

            gbois Gregory Boissinot
            michaelhuettermann Michael Hüttermann
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: