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

The "tools" block in a declarative pipeline gets silently ignored when not at same level as the agent clause

    XMLWordPrintable

Details

    Description

      The attached Jenkinsfile's "tools" block does not add the JDK's path to the PATH variable as expected.

      Workarounds:

      • Moving the "agent {label 'abc && def'}" line up to replace the top-level "agent none" results in the path to the JVM being set properly.
      • Moving the "tools" block up to line 6 so that it is at the same level as the "agent {label 'abc && def'}" clause also results in the path to the JVM being set properly.

      Please consider improving the usability here. It seems like if Jenkins is unable to honor a "tools" block that it shouldn't silently proceed. If it had printed an error stating that the tools block has to be associated to a new node allocation this would have been a quick problem to resolve.

       

      Attachments

        Activity

          gjd66402 Gordon Daugherty created issue -
          oleg_nenashev Oleg Nenashev made changes -
          Field Original Value New Value
          Component/s pipeline [ 21692 ]
          Component/s pipeline-model-definition-plugin [ 21706 ]
          Component/s core [ 15593 ]

          People

            Unassigned Unassigned
            gjd66402 Gordon Daugherty
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: