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

'Tool Home' does not expand environment variables

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      'Tool Home' does not appear to process environment variables or ~ ($HOME). I'd like to be specifying Tool Home to be ~/.rvm but it doesn't appear to be possible - instead it expands to: /Users/jenkins/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/ruby-1.9.3/~/.rvm

      More details: I'm trying to set up a tool which will install rvm, ruby, and bundler. My slave hosts are a mix of Linux (centos) and Mac OS X. RVM's default behavior (and one that I'm relying on) is to install to $HOME/.rvm. Of course, on Linux this is /home/jenkins and on Mac this is /Users/jenkins.

      Install script:

      if ! which rvm > /dev/null; then
          echo "Installing RVM"
          curl -kL https://get.rvm.io | bash -s stable --ruby
      fi
      
      if type -t rvm | head -n1 | grep -v 'function' > /dev/null; then
          JENKINS_RVM_PATH="$HOME/.rvm/scripts/rvm"
          source "$JENKINS_RVM_PATH"
      fi
      
      if ! ruby --version | grep 1.9.3p362 > /dev/null ; then
          if ! rvm use 1.9.3-p362 > /dev/null; then
              echo "Installing ruby 1.9.3"
              rvm install 1.9.3-p362
          fi
          rvm use 1.9.3-p362
      fi
      
      if ! which bundle > /dev/null; then
          echo "Installing bundler"
          gem install bundler
      fi
      

      Build log:

      Started by user mdougherty
      [ruby-1.9.3] $ sh -e /Users/jenkins/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/ruby-1.9.3/hudson7360731141557268923.sh
      ruby-1.9.3 is installed at /Users/jenkins/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/ruby-1.9.3/~/.rvm
      FATAL: /Users/jenkins/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/ruby-1.9.3/~/.rvm does not exist.
      /Users/jenkins/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/ruby-1.9.3/~/.rvm does not exist.
      	at org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(AbstractFileSet.java:483)
      	at org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(AbstractFileSet.java:460)
      	at com.cloudbees.jenkins.plugins.customtools.CustomTool$1.invoke(CustomTool.java:136)
      	at com.cloudbees.jenkins.plugins.customtools.CustomTool$1.invoke(CustomTool.java:131)
      	at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2348)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:118)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:48)
      	at hudson.remoting.Request$2.run(Request.java:326)
      	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
      	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      	at java.lang.Thread.run(Thread.java:680)
      

        Attachments

          Activity

          mikedougherty Mike Dougherty created issue -
          mikedougherty Mike Dougherty made changes -
          Field Original Value New Value
          Description 'Tool Home' does not appear to process environment variables or {{~}} ({{$HOME}}). I'd like to be specifying Tool Home to be {{~/.rvm}} but it doesn't appear to be possible - instead it expands to: {{/Users/jenkins/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/ruby-1.9.3/~/.rvm}}

          More details: I'm trying to set up a tool which will install rvm, ruby, and bundler. My slave hosts are a mix of Linux (centos) and Mac OS X. RVM's default behavior (and one that I'm relying on) is to install to {{${HOME}/.rvm}}. Of course, on Linux this is {{/home/jenkins}} and on Mac this is {{/Users/jenkins}}.

          Install script:
          {{
          if ! which rvm > /dev/null; then
              echo "Installing RVM"
              curl -kL https://get.rvm.io | bash -s stable --ruby
          fi

          if type -t rvm | head -n1 | grep -v 'function' > /dev/null; then
              JENKINS_RVM_PATH="$HOME/.rvm/scripts/rvm"
              source "$JENKINS_RVM_PATH"
          fi

          if ! ruby --version | grep 1.9.3p362 > /dev/null ; then
              if ! rvm use 1.9.3-p362 > /dev/null; then
                  echo "Installing ruby 1.9.3"
                  rvm install 1.9.3-p362
              fi
              rvm use 1.9.3-p362
          fi

          if ! which bundle > /dev/null; then
              echo "Installing bundler"
              gem install bundler
          fi
          }}

          Build log:
          {{
          Started by user mdougherty
          [ruby-1.9.3] $ sh -e /Users/jenkins/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/ruby-1.9.3/hudson7360731141557268923.sh
          ruby-1.9.3 is installed at /Users/jenkins/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/ruby-1.9.3/~/.rvm
          FATAL: /Users/jenkins/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/ruby-1.9.3/~/.rvm does not exist.
          /Users/jenkins/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/ruby-1.9.3/~/.rvm does not exist.
          at org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(AbstractFileSet.java:483)
          at org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(AbstractFileSet.java:460)
          at com.cloudbees.jenkins.plugins.customtools.CustomTool$1.invoke(CustomTool.java:136)
          at com.cloudbees.jenkins.plugins.customtools.CustomTool$1.invoke(CustomTool.java:131)
          at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2348)
          at hudson.remoting.UserRequest.perform(UserRequest.java:118)
          at hudson.remoting.UserRequest.perform(UserRequest.java:48)
          at hudson.remoting.Request$2.run(Request.java:326)
          at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
          at java.util.concurrent.FutureTask.run(FutureTask.java:138)
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
          at java.lang.Thread.run(Thread.java:680)
          }}


          'Tool Home' does not appear to process environment variables or {{\~}} ({{$HOME}}). I'd like to be specifying Tool Home to be {{~/.rvm}} but it doesn't appear to be possible - instead it expands to: {{/Users/jenkins/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/ruby-1.9.3/~/.rvm}}

          More details: I'm trying to set up a tool which will install rvm, ruby, and bundler. My slave hosts are a mix of Linux (centos) and Mac OS X. RVM's default behavior (and one that I'm relying on) is to install to {{${HOME}/.rvm}}. Of course, on Linux this is {{/home/jenkins}} and on Mac this is {{/Users/jenkins}}.

          Install script:
          {code}
          if ! which rvm > /dev/null; then
              echo "Installing RVM"
              curl -kL https://get.rvm.io | bash -s stable --ruby
          fi

          if type -t rvm | head -n1 | grep -v 'function' > /dev/null; then
              JENKINS_RVM_PATH="$HOME/.rvm/scripts/rvm"
              source "$JENKINS_RVM_PATH"
          fi

          if ! ruby --version | grep 1.9.3p362 > /dev/null ; then
              if ! rvm use 1.9.3-p362 > /dev/null; then
                  echo "Installing ruby 1.9.3"
                  rvm install 1.9.3-p362
              fi
              rvm use 1.9.3-p362
          fi

          if ! which bundle > /dev/null; then
              echo "Installing bundler"
              gem install bundler
          fi
          {code}

          Build log:
          {code}
          Started by user mdougherty
          [ruby-1.9.3] $ sh -e /Users/jenkins/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/ruby-1.9.3/hudson7360731141557268923.sh
          ruby-1.9.3 is installed at /Users/jenkins/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/ruby-1.9.3/~/.rvm
          FATAL: /Users/jenkins/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/ruby-1.9.3/~/.rvm does not exist.
          /Users/jenkins/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/ruby-1.9.3/~/.rvm does not exist.
          at org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(AbstractFileSet.java:483)
          at org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(AbstractFileSet.java:460)
          at com.cloudbees.jenkins.plugins.customtools.CustomTool$1.invoke(CustomTool.java:136)
          at com.cloudbees.jenkins.plugins.customtools.CustomTool$1.invoke(CustomTool.java:131)
          at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2348)
          at hudson.remoting.UserRequest.perform(UserRequest.java:118)
          at hudson.remoting.UserRequest.perform(UserRequest.java:48)
          at hudson.remoting.Request$2.run(Request.java:326)
          at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
          at java.util.concurrent.FutureTask.run(FutureTask.java:138)
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
          at java.lang.Thread.run(Thread.java:680)
          {code}
          mikedougherty Mike Dougherty made changes -
          Description 'Tool Home' does not appear to process environment variables or {{\~}} ({{$HOME}}). I'd like to be specifying Tool Home to be {{~/.rvm}} but it doesn't appear to be possible - instead it expands to: {{/Users/jenkins/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/ruby-1.9.3/~/.rvm}}

          More details: I'm trying to set up a tool which will install rvm, ruby, and bundler. My slave hosts are a mix of Linux (centos) and Mac OS X. RVM's default behavior (and one that I'm relying on) is to install to {{${HOME}/.rvm}}. Of course, on Linux this is {{/home/jenkins}} and on Mac this is {{/Users/jenkins}}.

          Install script:
          {code}
          if ! which rvm > /dev/null; then
              echo "Installing RVM"
              curl -kL https://get.rvm.io | bash -s stable --ruby
          fi

          if type -t rvm | head -n1 | grep -v 'function' > /dev/null; then
              JENKINS_RVM_PATH="$HOME/.rvm/scripts/rvm"
              source "$JENKINS_RVM_PATH"
          fi

          if ! ruby --version | grep 1.9.3p362 > /dev/null ; then
              if ! rvm use 1.9.3-p362 > /dev/null; then
                  echo "Installing ruby 1.9.3"
                  rvm install 1.9.3-p362
              fi
              rvm use 1.9.3-p362
          fi

          if ! which bundle > /dev/null; then
              echo "Installing bundler"
              gem install bundler
          fi
          {code}

          Build log:
          {code}
          Started by user mdougherty
          [ruby-1.9.3] $ sh -e /Users/jenkins/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/ruby-1.9.3/hudson7360731141557268923.sh
          ruby-1.9.3 is installed at /Users/jenkins/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/ruby-1.9.3/~/.rvm
          FATAL: /Users/jenkins/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/ruby-1.9.3/~/.rvm does not exist.
          /Users/jenkins/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/ruby-1.9.3/~/.rvm does not exist.
          at org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(AbstractFileSet.java:483)
          at org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(AbstractFileSet.java:460)
          at com.cloudbees.jenkins.plugins.customtools.CustomTool$1.invoke(CustomTool.java:136)
          at com.cloudbees.jenkins.plugins.customtools.CustomTool$1.invoke(CustomTool.java:131)
          at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2348)
          at hudson.remoting.UserRequest.perform(UserRequest.java:118)
          at hudson.remoting.UserRequest.perform(UserRequest.java:48)
          at hudson.remoting.Request$2.run(Request.java:326)
          at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
          at java.util.concurrent.FutureTask.run(FutureTask.java:138)
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
          at java.lang.Thread.run(Thread.java:680)
          {code}
          'Tool Home' does not appear to process environment variables or {{\~}} ({{$HOME}}). I'd like to be specifying Tool Home to be {{\~/.rvm}} but it doesn't appear to be possible - instead it expands to: {{/Users/jenkins/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/ruby-1.9.3/\~/.rvm}}

          More details: I'm trying to set up a tool which will install rvm, ruby, and bundler. My slave hosts are a mix of Linux (centos) and Mac OS X. RVM's default behavior (and one that I'm relying on) is to install to {{$HOME/.rvm}}. Of course, on Linux this is {{/home/jenkins}} and on Mac this is {{/Users/jenkins}}.

          Install script:
          {code}
          if ! which rvm > /dev/null; then
              echo "Installing RVM"
              curl -kL https://get.rvm.io | bash -s stable --ruby
          fi

          if type -t rvm | head -n1 | grep -v 'function' > /dev/null; then
              JENKINS_RVM_PATH="$HOME/.rvm/scripts/rvm"
              source "$JENKINS_RVM_PATH"
          fi

          if ! ruby --version | grep 1.9.3p362 > /dev/null ; then
              if ! rvm use 1.9.3-p362 > /dev/null; then
                  echo "Installing ruby 1.9.3"
                  rvm install 1.9.3-p362
              fi
              rvm use 1.9.3-p362
          fi

          if ! which bundle > /dev/null; then
              echo "Installing bundler"
              gem install bundler
          fi
          {code}

          Build log:
          {code}
          Started by user mdougherty
          [ruby-1.9.3] $ sh -e /Users/jenkins/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/ruby-1.9.3/hudson7360731141557268923.sh
          ruby-1.9.3 is installed at /Users/jenkins/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/ruby-1.9.3/~/.rvm
          FATAL: /Users/jenkins/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/ruby-1.9.3/~/.rvm does not exist.
          /Users/jenkins/tools/com.cloudbees.jenkins.plugins.customtools.CustomTool/ruby-1.9.3/~/.rvm does not exist.
          at org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(AbstractFileSet.java:483)
          at org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(AbstractFileSet.java:460)
          at com.cloudbees.jenkins.plugins.customtools.CustomTool$1.invoke(CustomTool.java:136)
          at com.cloudbees.jenkins.plugins.customtools.CustomTool$1.invoke(CustomTool.java:131)
          at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2348)
          at hudson.remoting.UserRequest.perform(UserRequest.java:118)
          at hudson.remoting.UserRequest.perform(UserRequest.java:48)
          at hudson.remoting.Request$2.run(Request.java:326)
          at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
          at java.util.concurrent.FutureTask.run(FutureTask.java:138)
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
          at java.lang.Thread.run(Thread.java:680)
          {code}
          mikedougherty Mike Dougherty made changes -
          Summary 'Tool Home' is does not expand environment variabls 'Tool Home' does not expand environment variabls
          mikedougherty Mike Dougherty made changes -
          Summary 'Tool Home' does not expand environment variabls 'Tool Home' does not expand environment variables
          oleg_nenashev Oleg Nenashev made changes -
          Assignee recampbell [ recampbell ] Oleg Nenashev [ oleg_nenashev ]
          oleg_nenashev Oleg Nenashev made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          oleg_nenashev Oleg Nenashev made changes -
          Status In Progress [ 3 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 149140 ] JNJira + In-Review [ 192993 ]

            People

            • Assignee:
              oleg_nenashev Oleg Nenashev
              Reporter:
              mikedougherty Mike Dougherty
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: