• Declarative - 1.2

      given the following pipeline, I would expect the java version "1.8" to be printed, but this is not the case - instead I get "1.7"; the default version of the underlying system.

      pipeline {
          agent none
          tools {
              jdk "Oracle JDK 1.8 (latest)"
          }    
          stages {
              stage ('prepare') {
                  agent any
                  steps {
                      sh "java -version"
                  }
              }
          }
      }
      

      but this one works as:

      pipeline {
          agent any
          tools {
              jdk "Oracle JDK 1.8 (latest)"
          }    
          stages {
              stage ('prepare') {
                  steps {
                      sh "java -version"
                  }
              }
          }
      }
      

      ...my expectation is, that the tools on top scope are installed on all agents.

          [JENKINS-42338] default tools not installed on agent

          Dominik Bartholdi created issue -

          Andrew Bayer added a comment -

          The current behavior is to install the tools on the agent at the same scope, but let me think about it.

          Andrew Bayer added a comment - The current behavior is to install the tools on the agent at the same scope, but let me think about it.

          Yixiao Lin added a comment -

          +1 for this issue. 

          Using JNLP shared agent on bare metal, when the agent container is started, only the workspace is mounted, the tool directory is not mounted to the agent, causing a file not found when trying to use the tool.
          docker run -t -d -u 3000:3000 --group-add 3001 -w /fowler/home/jenkins/shared-slave-02/78f00166/workspace/eline-examples_simple-image-ZNTTP2NBN2FYSNJY57ZCNLWOOIDPBUDOXO5NU37YMKIJMLTKRHLA -v /fowler/home/jenkins/shared-slave-02/78f00166/workspace/eline-examples_simple-image-ZNTTP2NBN2FYSNJY57ZCNLWOOIDPBUDOXO5NU37YMKIJMLTKRHLA:/fowler/home/jenkins/shared-slave-02/78f00166/workspace/eline-examples_simple-image-ZNTTP2NBN2FYSNJY57ZCNLWOOIDPBUDOXO5NU37YMKIJMLTKRHLA:rw -v /fowler/home/jenkins/shared-slave-02/78f00166/workspace/eline-examples_simple-image-ZNTTP2NBN2FYSNJY57ZCNLWOOIDPBUDOXO5NU37YMKIJMLTKRHLA@tmp:/fowler/home/jenkins/shared-slave-02/78f00166/workspace/eline-examples_simple-image-ZNTTP2NBN2FYSNJY57ZCNLWOOIDPBUDOXO5NU37YMKIJMLTKRHLA@tmp:rw -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** --entrypoint cat ubuntu

          resulting in:

          [eline-examples_simple-image-ZNTTP2NBN2FYSNJY57ZCNLWOOIDPBUDOXO5NU37YMKIJMLTKRHLA] Running shell script
          + mvn -version
          /fowler/home/jenkins/shared-slave-02/78f00166/workspace/eline-examples_simple-image-ZNTTP2NBN2FYSNJY57ZCNLWOOIDPBUDOXO5NU37YMKIJMLTKRHLA@tmp/durable-ebc5c837/script.sh: 2: /fowler/home/jenkins/shared-slave-02/78f00166/workspace/eline-examples_simple-image-ZNTTP2NBN2FYSNJY57ZCNLWOOIDPBUDOXO5NU37YMKIJMLTKRHLA@tmp/durable-ebc5c837/script.sh: mvn: not found

          Yixiao Lin added a comment - +1 for this issue.  Using JNLP shared agent on bare metal, when the agent container is started, only the workspace is mounted, the tool directory is not mounted to the agent, causing a file not found when trying to use the tool. docker run -t -d -u 3000:3000 --group-add 3001 -w /fowler/home/jenkins/shared-slave-02/78f00166/workspace/eline-examples_simple-image-ZNTTP2NBN2FYSNJY57ZCNLWOOIDPBUDOXO5NU37YMKIJMLTKRHLA -v /fowler/home/jenkins/shared-slave-02/78f00166/workspace/eline-examples_simple-image-ZNTTP2NBN2FYSNJY57ZCNLWOOIDPBUDOXO5NU37YMKIJMLTKRHLA:/fowler/home/jenkins/shared-slave-02/78f00166/workspace/eline-examples_simple-image-ZNTTP2NBN2FYSNJY57ZCNLWOOIDPBUDOXO5NU37YMKIJMLTKRHLA:rw -v /fowler/home/jenkins/shared-slave-02/78f00166/workspace/eline-examples_simple-image-ZNTTP2NBN2FYSNJY57ZCNLWOOIDPBUDOXO5NU37YMKIJMLTKRHLA@tmp:/fowler/home/jenkins/shared-slave-02/78f00166/workspace/eline-examples_simple-image-ZNTTP2NBN2FYSNJY57ZCNLWOOIDPBUDOXO5NU37YMKIJMLTKRHLA@tmp:rw -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** --entrypoint cat ubuntu resulting in: [eline-examples_simple-image-ZNTTP2NBN2FYSNJY57ZCNLWOOIDPBUDOXO5NU37YMKIJMLTKRHLA] Running shell script + mvn -version /fowler/home/jenkins/shared-slave-02/78f00166/workspace/eline-examples_simple-image-ZNTTP2NBN2FYSNJY57ZCNLWOOIDPBUDOXO5NU37YMKIJMLTKRHLA@tmp/durable-ebc5c837/script.sh: 2: /fowler/home/jenkins/shared-slave-02/78f00166/workspace/eline-examples_simple-image-ZNTTP2NBN2FYSNJY57ZCNLWOOIDPBUDOXO5NU37YMKIJMLTKRHLA@tmp/durable-ebc5c837/script.sh: mvn: not found
          Andrew Bayer made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Andrew Bayer made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]

          Andrew Bayer added a comment -

          Andrew Bayer added a comment - PR up at https://github.com/jenkinsci/pipeline-model-definition-plugin/pull/168
          Andrew Bayer made changes -
          Remote Link New: This issue links to "PR #168 (Web Link)" [ 17218 ]
          James Dumay made changes -
          Epic Link New: JENKINS-45428 [ 183596 ]
          James Dumay made changes -
          Sprint New: Declarative - 1.2 [ 366 ]
          James Dumay made changes -
          Rank New: Ranked higher

            abayer Andrew Bayer
            imod Dominik Bartholdi
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: