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

Unable to use VERSION environment variable

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Component/s: customtools-plugin
    • Labels:
      None
    • Environment:
      Jenkins 1.646
      Custom Tools Plugin 0.4.4
      Extended Choice Parameter Plug-In 0.28
    • Similar Issues:

      Description

      I have defined a `phpenv` custom tool which has a `PHP_VERSION` parameter which allows the requested PHP version to be specified. The installation script for this custom tool is roughly as follows:

      ```
      export PHPENV_ROOT=$(pwd)/phpenv
      export PATH="$PATH:$(pwd)/phpenv/bin"

      if test -d $PHPENV_ROOT; then
      $PHPENV_ROOT/bin/phpenv update
      else
      (curl -L http://git.io/phpenv-installer | bash)
      fi

      phpenv install $PHP_VERSION
      phpenv global $PHP_VERSION
      ```

      It seems, however, that the `$PHP_VERSION` environment variable is not set. Am I correct in thinking that the version parameter is exposed through an environment variable?

        Attachments

          Activity

          Hide
          oleg_nenashev Oleg Nenashev added a comment -

          Please try ${PHP_VERSION} . Custom tools resolves only parameters in brackets

          Show
          oleg_nenashev Oleg Nenashev added a comment - Please try ${PHP_VERSION} . Custom tools resolves only parameters in brackets
          Hide
          joshuaspence Joshua Spence added a comment -

          Yeah, I had tried `${PHP_VERSION}` previously but that didn't work either.

          Show
          joshuaspence Joshua Spence added a comment - Yeah, I had tried `${PHP_VERSION}` previously but that didn't work either.
          Hide
          joshuaspence Joshua Spence added a comment -

          Here is a job definition which doesn't seem to work:

          ```
          <project>
          <actions/>
          <description/>
          <keepDependencies>false</keepDependencies>
          <properties>
          <hudson.model.ParametersDefinitionProperty>
          <parameterDefinitions>
          <com.synopsys.arc.jenkinsci.plugins.customtools.versions.ToolVersionParameterDefinition plugin="custom-tools-plugin@0.4.4">
          <name>PHP_VERSION</name>
          <description>Version of PHP to be installed</description>
          <toolName>phpenv</toolName>
          </com.synopsys.arc.jenkinsci.plugins.customtools.versions.ToolVersionParameterDefinition>
          </parameterDefinitions>
          </hudson.model.ParametersDefinitionProperty>
          </properties>
          <scm class="hudson.scm.NullSCM"/>
          <canRoam>true</canRoam>
          <disabled>false</disabled>
          <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
          <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
          <triggers/>
          <concurrentBuild>false</concurrentBuild>
          <builders/>
          <publishers/>
          <buildWrappers>
          <com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper plugin="custom-tools-plugin@0.4.4">
          <selectedTools>
          <com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper_-SelectedTool>
          <name>phpenv</name>
          </com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper_-SelectedTool>
          </selectedTools>
          <multiconfigOptions>
          <skipMasterInstallation>false</skipMasterInstallation>
          </multiconfigOptions>
          <convertHomesToUppercase>false</convertHomesToUppercase>
          </com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper>
          </buildWrappers>
          </project>
          ```

          Show
          joshuaspence Joshua Spence added a comment - Here is a job definition which doesn't seem to work: ``` <project> <actions/> <description/> <keepDependencies>false</keepDependencies> <properties> <hudson.model.ParametersDefinitionProperty> <parameterDefinitions> <com.synopsys.arc.jenkinsci.plugins.customtools.versions.ToolVersionParameterDefinition plugin="custom-tools-plugin@0.4.4"> <name>PHP_VERSION</name> <description>Version of PHP to be installed</description> <toolName>phpenv</toolName> </com.synopsys.arc.jenkinsci.plugins.customtools.versions.ToolVersionParameterDefinition> </parameterDefinitions> </hudson.model.ParametersDefinitionProperty> </properties> <scm class="hudson.scm.NullSCM"/> <canRoam>true</canRoam> <disabled>false</disabled> <blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding> <blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding> <triggers/> <concurrentBuild>false</concurrentBuild> <builders/> <publishers/> <buildWrappers> <com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper plugin="custom-tools-plugin@0.4.4"> <selectedTools> <com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper_-SelectedTool> <name>phpenv</name> </com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper_-SelectedTool> </selectedTools> <multiconfigOptions> <skipMasterInstallation>false</skipMasterInstallation> </multiconfigOptions> <convertHomesToUppercase>false</convertHomesToUppercase> </com.cloudbees.jenkins.plugins.customtools.CustomToolInstallWrapper> </buildWrappers> </project> ```
          Hide
          oleg_nenashev Oleg Nenashev added a comment -

          I will have a really small bandwith in the community in the next months, see https://groups.google.com/d/msg/jenkinsci-dev/uc6NsMoCFQI/AIO4WG1UCwAJ for the context. I decided to mark this plugin for adoption and unassigned tickets so that anybody is welcome to take over the plugin and to become a maintainer. Some tickets already have pending pull requests which can be finalized.

          Show
          oleg_nenashev Oleg Nenashev added a comment - I will have a really small bandwith in the community in the next months, see https://groups.google.com/d/msg/jenkinsci-dev/uc6NsMoCFQI/AIO4WG1UCwAJ for the context. I decided to mark this plugin for adoption and unassigned tickets so that anybody is welcome to take over the plugin and to become a maintainer. Some tickets already have pending pull requests which can be finalized.

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            joshuaspence Joshua Spence
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: