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

Setting default directory when using container()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • kubernetes-plugin
    • None

      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") {
          ...   
        }
      }
      

       

            Unassigned Unassigned
            piratejohnny Jon B
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: