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

Setting default directory when using container()

    Details

    • Similar Issues:

      Description

      We use the kubernetes plugin with enterprise jenkins. As soon as developers refer to one of their containers from their pod template, the first thing they usually want to do is to cd into a certain directory. What's the best way to do this in order to avoid making them do a "cd" over and over again in their sh'es? The dir() function does not work unfortunately (perhaps it only works in the jenkins jnlp container?)

       

      Ideally we could do something like this:

       

      container(name: 'mycontainer', dir: "/home/app/foo") {
        ... 
      }
      

       

      or...

      container(name: 'mycontainer') {
        dir("/home/app/foo") {
          ...   
        }
      }
      

       

        Attachments

          Activity

          There are no comments yet on this issue.

            People

            • Assignee:
              Unassigned
              Reporter:
              piratejohnny Jon B
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: