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

Can not read Environment variables `NVM_NODEJS_ORG_MIRROR`

      ```bash
      $ echo $NVM_NODEJS_ORG_MIRROR
      http://npm.taobao.org/mirrors/node
      ```

      ``` console
      1:49:25 curl: (56) SSL read: error:00000000:lib(0):func(0):reason(0), errno 104
      11:49:25 Binary download from https://nodejs.org/dist/v6.9.2/node-v6.9.2.tar.xz failed, trying source.
      11:49:25 grep: /root/.nvm/.cache/src/node-v6.9.2/node-v6.9.2.tar.xz: No such file or directory
      11:49:25 Provided file to checksum does not exist.
      11:49:25 nvm: install v6.9.2 failed!
      ```

      I need to download node from mirror, but Jenkins still download from the official website.

          [JENKINS-40268] Can not read Environment variables `NVM_NODEJS_ORG_MIRROR`

          Tomas Salazar added a comment - - edited

          The best solution that comes to my mind is to put NVM_NODEJS_ORG_MIRROR, $NVM_IOJS_ORG_MIRROR as configurable params.

          Tomas Salazar added a comment - - edited The best solution that comes to my mind is to put NVM_NODEJS_ORG_MIRROR, $NVM_IOJS_ORG_MIRROR as configurable params.

          Tomas Salazar added a comment -

          Tomas Salazar added a comment - If you have some time  https://github.com/jenkinsci/nvm-wrapper-plugin/pull/4

          Code changed in jenkins
          User: atomsfat
          Path:
          README.md
          gradle/wrapper/gradle-wrapper.properties
          src/main/java/org/jenkinsci/plugins/nvm/NvmWrapper.java
          src/main/java/org/jenkinsci/plugins/nvm/NvmWrapperUtil.java
          src/main/resources/index.groovy
          src/main/resources/org/jenkinsci/plugins/nvm/NvmWrapper/config.groovy
          src/main/resources/org/jenkinsci/plugins/nvm/NvmWrapper/help-nvmInstallURL.html
          src/main/resources/org/jenkinsci/plugins/nvm/NvmWrapper/help-nvmIoJsOrgMirror.html
          src/main/resources/org/jenkinsci/plugins/nvm/NvmWrapper/help-nvmNodeJsOrgMirror.html
          http://jenkins-ci.org/commit/nvm-wrapper-plugin/bb70f9c89db02ace8a9e1d419a23db589007d4ea
          Log:
          Add support to environment variables (Advanced options)

          Fix https://issues.jenkins-ci.org/browse/JENKINS-40268

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: atomsfat Path: README.md gradle/wrapper/gradle-wrapper.properties src/main/java/org/jenkinsci/plugins/nvm/NvmWrapper.java src/main/java/org/jenkinsci/plugins/nvm/NvmWrapperUtil.java src/main/resources/index.groovy src/main/resources/org/jenkinsci/plugins/nvm/NvmWrapper/config.groovy src/main/resources/org/jenkinsci/plugins/nvm/NvmWrapper/help-nvmInstallURL.html src/main/resources/org/jenkinsci/plugins/nvm/NvmWrapper/help-nvmIoJsOrgMirror.html src/main/resources/org/jenkinsci/plugins/nvm/NvmWrapper/help-nvmNodeJsOrgMirror.html http://jenkins-ci.org/commit/nvm-wrapper-plugin/bb70f9c89db02ace8a9e1d419a23db589007d4ea Log: Add support to environment variables (Advanced options) Fix https://issues.jenkins-ci.org/browse/JENKINS-40268

          Code changed in jenkins
          User: Tomas Salazar
          Path:
          README.md
          gradle/wrapper/gradle-wrapper.properties
          src/main/java/org/jenkinsci/plugins/nvm/NvmWrapper.java
          src/main/java/org/jenkinsci/plugins/nvm/NvmWrapperUtil.java
          src/main/resources/index.groovy
          src/main/resources/org/jenkinsci/plugins/nvm/NvmWrapper/config.groovy
          src/main/resources/org/jenkinsci/plugins/nvm/NvmWrapper/help-nvmInstallURL.html
          src/main/resources/org/jenkinsci/plugins/nvm/NvmWrapper/help-nvmIoJsOrgMirror.html
          src/main/resources/org/jenkinsci/plugins/nvm/NvmWrapper/help-nvmNodeJsOrgMirror.html
          http://jenkins-ci.org/commit/nvm-wrapper-plugin/00590d3e1c93bc135a91905baf205ba4bade6dc4
          Log:
          Merge pull request #4 from atomsfat/feature/JENKINS-40268-environment-variables

          Add support to environment variables (Advanced options)

          Compare: https://github.com/jenkinsci/nvm-wrapper-plugin/compare/f252c5fb55de...00590d3e1c93

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Tomas Salazar Path: README.md gradle/wrapper/gradle-wrapper.properties src/main/java/org/jenkinsci/plugins/nvm/NvmWrapper.java src/main/java/org/jenkinsci/plugins/nvm/NvmWrapperUtil.java src/main/resources/index.groovy src/main/resources/org/jenkinsci/plugins/nvm/NvmWrapper/config.groovy src/main/resources/org/jenkinsci/plugins/nvm/NvmWrapper/help-nvmInstallURL.html src/main/resources/org/jenkinsci/plugins/nvm/NvmWrapper/help-nvmIoJsOrgMirror.html src/main/resources/org/jenkinsci/plugins/nvm/NvmWrapper/help-nvmNodeJsOrgMirror.html http://jenkins-ci.org/commit/nvm-wrapper-plugin/00590d3e1c93bc135a91905baf205ba4bade6dc4 Log: Merge pull request #4 from atomsfat/feature/ JENKINS-40268 -environment-variables Add support to environment variables (Advanced options) Compare: https://github.com/jenkinsci/nvm-wrapper-plugin/compare/f252c5fb55de...00590d3e1c93

          Tomas Salazar added a comment -

          Solved in version 0.1.2

          Tomas Salazar added a comment - Solved in version 0.1.2

          I think this change introduced a regression. It now uses System.getProperty("user.home") instead of "~" for the home directory, which causes the home directory of the Jenkins master to be used instead of the Jenkins slave. For example, I get:

          $ bash -c "source /var/lib/jenkins/.nvm/nvm.sh && NVM_NODEJS_ORG_MIRROR=https://nodejs.org/dist nvm install v7.8.0 && nvm use v7.8.0 && export > nvm.env"
          bash: /var/lib/jenkins/.nvm/nvm.sh: No such file or directory
          

          When my slave home directory is actually /home/jenkins.

          Trevor Robinson added a comment - I think this change introduced a regression. It now uses System.getProperty("user.home") instead of "~" for the home directory, which causes the home directory of the Jenkins master to be used instead of the Jenkins slave. For example, I get: $ bash -c "source / var /lib/jenkins/.nvm/nvm.sh && NVM_NODEJS_ORG_MIRROR=https: //nodejs.org/dist nvm install v7.8.0 && nvm use v7.8.0 && export > nvm.env" bash: / var /lib/jenkins/.nvm/nvm.sh: No such file or directory When my slave home directory is actually /home/jenkins .

          Tomas Salazar added a comment -

          scurrilous I created a issue to track this problem JENKINS-45784

          Tomas Salazar added a comment - scurrilous I created a issue to track this problem JENKINS-45784

            atoms Tomas Salazar
            gucong gu cong
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: