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

"dir" context is not honored by "sh" step

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: kubernetes-plugin
    • Labels:
      None
    • Environment:
      Jenkins 2.32.1
      pipeline 2.4
      kubernetes-plugin 0.10
    • Similar Issues:

      Description

      If pipeline has dir wrapper, i.e.

      podTemplate(...) {
        node('pod') {
          container('mycontainer') {
            dir('my/dir/path') {
              sh 'ls -l'
            }
          }
        }
      }
      

      shell step is still executed in the context of workspace root.
      Same pipeline works as expected (within directory path specified by dir step) outside of kubernetes pod.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                csanchez Carlos Sanchez
                Reporter:
                electroma Roman Safronov
              • Votes:
                1 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: