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

ConfigFileProvider variable is not seen by EnvInject

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      The ConfigFileProvider plugin copies a file to the workspace then sets an environment variable to the path of the copied file.
      If this variable is referenced in EnvInject properties, it fails to be injected with an "unresolved variable" error.
      The behavior is similar to what happens with ToolEnv variables when it is not enabled in the "prepare environment for run" section

        Attachments

          Activity

          Hide
          gbois Gregory Boissinot added a comment -

          For the ToolEnvPlugin, as I comment in the Tool Environment Plugin wiki page, this plugin is not compatible with this plugin.
          You have to use the SharedObjects plugin (https://wiki.jenkins-ci.org/display/JENKINS/SharedObjects+Plugin). It covers Tool Env features and has a good integration with the EnvInject plugin.

          Show
          gbois Gregory Boissinot added a comment - For the ToolEnvPlugin, as I comment in the Tool Environment Plugin wiki page, this plugin is not compatible with this plugin. You have to use the SharedObjects plugin ( https://wiki.jenkins-ci.org/display/JENKINS/SharedObjects+Plugin ). It covers Tool Env features and has a good integration with the EnvInject plugin.
          Hide
          gbois Gregory Boissinot added a comment -

          For the ConfigFileProvider plugin, environment variables are injected by a build wrapper extension. Therefore EnvInject plugin can't capture these new injected environment variables due to Jenkins architecture.
          It should be good if the ConfigFileProvider plugin switch to EnvironmentContributionAction

          Show
          gbois Gregory Boissinot added a comment - For the ConfigFileProvider plugin, environment variables are injected by a build wrapper extension. Therefore EnvInject plugin can't capture these new injected environment variables due to Jenkins architecture. It should be good if the ConfigFileProvider plugin switch to EnvironmentContributionAction
          Hide
          lfalberti lionel alberti added a comment -

          I noticed that the SetEnv plugin is able to get access to the ConfigFileProvider environment variable.
          I'm new to Jenkins code, could you kindly point me to an explanation of that shift in behavior?

          Show
          lfalberti lionel alberti added a comment - I noticed that the SetEnv plugin is able to get access to the ConfigFileProvider environment variable. I'm new to Jenkins code, could you kindly point me to an explanation of that shift in behavior?
          Hide
          gbois Gregory Boissinot added a comment -

          I think it works due to an order issue (alphabetic order) for the list of wrapper plugin type.
          The sentenv plugin might be executed after the ConfigFileProvider.
          Could you attach your job configuration file (config.xml)?

          Show
          gbois Gregory Boissinot added a comment - I think it works due to an order issue (alphabetic order) for the list of wrapper plugin type. The sentenv plugin might be executed after the ConfigFileProvider. Could you attach your job configuration file (config.xml)?
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Gregory Boissinot
          Path:
          pom.xml
          http://jenkins-ci.org/commit/envinject-plugin/8b24daccd99c5c1e0c72fa5fc19b218f51f69129
          Log:
          Upgrade to Jenkins 1.437 for fixing JENKINS-14897

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Gregory Boissinot Path: pom.xml http://jenkins-ci.org/commit/envinject-plugin/8b24daccd99c5c1e0c72fa5fc19b218f51f69129 Log: Upgrade to Jenkins 1.437 for fixing JENKINS-14897
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Gregory Boissinot
          Path:
          src/main/java/org/jenkinsci/plugins/envinject/service/EnvInjectVariableGetter.java
          http://jenkins-ci.org/commit/envinject-plugin/1adb4759d1a338747d063e3266739d52195d8f67
          Log:
          Fix JENKINS-14897

          Compare: https://github.com/jenkinsci/envinject-plugin/compare/9d7fc88f4e89...1adb4759d1a3

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Gregory Boissinot Path: src/main/java/org/jenkinsci/plugins/envinject/service/EnvInjectVariableGetter.java http://jenkins-ci.org/commit/envinject-plugin/1adb4759d1a338747d063e3266739d52195d8f67 Log: Fix JENKINS-14897 Compare: https://github.com/jenkinsci/envinject-plugin/compare/9d7fc88f4e89...1adb4759d1a3
          Hide
          gbois Gregory Boissinot added a comment -

          The version 1.68 should fix the issue.

          Show
          gbois Gregory Boissinot added a comment - The version 1.68 should fix the issue.
          Hide
          lfalberti lionel alberti added a comment -

          Thank you for the fix. The variable in ConfigFileProvider is injected now.

          Show
          lfalberti lionel alberti added a comment - Thank you for the fix. The variable in ConfigFileProvider is injected now.

            People

            • Assignee:
              gbois Gregory Boissinot
              Reporter:
              lfalberti lionel alberti
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: