-
Bug
-
Resolution: Unresolved
-
Minor
-
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") { ... } }
[JENKINS-60396] Setting default directory when using container()
Description |
Original:
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: contatiner(name: 'mycontainer', dir: "/home/app/foo") { ... } or... contatiner(name: 'mycontainer') { dir("/home/app/foo") { ... } } |
New:
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: ``` contatiner(name: 'mycontainer', dir: "/home/app/foo") { ... } ``` or... contatiner(name: 'mycontainer') { dir("/home/app/foo") { ... } } |
Description |
Original:
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: ``` contatiner(name: 'mycontainer', dir: "/home/app/foo") { ... } ``` or... contatiner(name: 'mycontainer') { dir("/home/app/foo") { ... } } |
New:
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: {code:java} container(name: 'mycontainer', dir: "/home/app/foo") { ... } {code} or... {code:java} container(name: 'mycontainer') { dir("/home/app/foo") { ... } } {code} |