[JIRA] (JENKINS-60396) Setting default directory when using container()

4 views
Skip to first unread message

block.jon@gmail.com (JIRA)

unread,
Dec 7, 2019, 10:00:02 AM12/7/19
to jenkinsc...@googlegroups.com
Jon B updated an issue
 
Jenkins / Bug JENKINS-60396
Setting default directory when using container()
Change By: Jon B
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")
{

{
    ...
  }

}
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

block.jon@gmail.com (JIRA)

unread,
Dec 7, 2019, 10:00:03 AM12/7/19
to jenkinsc...@googlegroups.com
Jon B created an issue
Issue Type: Bug Bug
Assignee: Unassigned
Components: kubernetes-plugin
Created: 2019-12-07 14:59
Priority: Minor Minor
Reporter: Jon B

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")

{     ...   }

}

Add Comment Add Comment
 

block.jon@gmail.com (JIRA)

unread,
Dec 7, 2019, 10:01:03 AM12/7/19
to jenkinsc...@googlegroups.com
Jon B updated an issue
Change By: Jon B
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}
```

contatiner
container (name: 'mycontainer', dir: "/home/app/foo")

{
 ...
}
{code}
```  

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


{
    ...  
}
}
{code }
 
Reply all
Reply to author
Forward
0 new messages