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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • kubernetes-plugin
    • None
    • Jenkins 2.32.1
      pipeline 2.4
      kubernetes-plugin 0.10

    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

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

              Dates

                Created:
                Updated:
                Resolved: