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

can Variables get injected as Build Variables rather than Environment Variables?

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Component/s: envinject-plugin
    • Labels:
      None
    • Similar Issues:

      Description

      Variables get injected as Environment Variables, and are thus available to subsequent (unrelated) jobs.
      It would be a big improvement if the scope of variables set with EnvInject can be limited to the build in which they are injected.

        Attachments

          Activity

          Hide
          gbois Gregory Boissinot added a comment -

          Only system environment variables are shared between jobs.
          Other variables and your injected variables shouldn't be shared by other jobs.
          If it is not the case, it's a bug.
          Could you let me know more information?

          Show
          gbois Gregory Boissinot added a comment - Only system environment variables are shared between jobs. Other variables and your injected variables shouldn't be shared by other jobs. If it is not the case, it's a bug. Could you let me know more information?
          Hide
          josbraaksma Jos Braaksma added a comment -

          my job injects variables from a file taken from SVN as a Build Environment step.
          the job has a Execute Shell build step that calls 'env'

          a first build (after Jenkins restart) behaves as expected; env prints system envirnment variables and the injected variables from the file.

          I then changed the contents of the properties file, removed the properties that were there and added a new one.

          subsequent builds (on the master) still print the 'old' properties.
          the job triggered by this job (the node on which it is executed is actually determined by the injected variable from the properties file) also prints the old properties; it is likely that all jobs on the node (master) have access to the properties injected, therefor also likely that one job could overwrite the properties of another job if they have the same name.

          (Great work by the way, much appreciated!)

          Show
          josbraaksma Jos Braaksma added a comment - my job injects variables from a file taken from SVN as a Build Environment step. the job has a Execute Shell build step that calls 'env' a first build (after Jenkins restart) behaves as expected; env prints system envirnment variables and the injected variables from the file. I then changed the contents of the properties file, removed the properties that were there and added a new one. subsequent builds (on the master) still print the 'old' properties. the job triggered by this job (the node on which it is executed is actually determined by the injected variable from the properties file) also prints the old properties; it is likely that all jobs on the node (master) have access to the properties injected, therefor also likely that one job could overwrite the properties of another job if they have the same name. (Great work by the way, much appreciated!)
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Gregory
          Path:
          src/main/java/org/jenkinsci/plugins/envinject/service/EnvInjectActionSetter.java
          http://jenkins-ci.org/commit/envinject-plugin/b3af677cb69b092b7f03b25c878f91b3c84134fe
          Log:
          Fixed JENKINS-10919

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Gregory Path: src/main/java/org/jenkinsci/plugins/envinject/service/EnvInjectActionSetter.java http://jenkins-ci.org/commit/envinject-plugin/b3af677cb69b092b7f03b25c878f91b3c84134fe Log: Fixed JENKINS-10919
          Hide
          gbois Gregory Boissinot added a comment -

          Fixed in 0.13

          Show
          gbois Gregory Boissinot added a comment - Fixed in 0.13
          Hide
          josbraaksma Jos Braaksma added a comment -

          confirmed that parameters are not available to subsequent builds anymore.

          thnx

          Show
          josbraaksma Jos Braaksma added a comment - confirmed that parameters are not available to subsequent builds anymore. thnx

            People

            • Assignee:
              gbois Gregory Boissinot
              Reporter:
              josbraaksma Jos Braaksma
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: