Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to control the workspace Jenkins starts the build on?

I have one Jenkins master node and 2 Jenkins slave nodes. All my job builds happen in the slave node. When I configured my slaves, I set the Remote root directory as /data/home/jenkins/jenkins-slave. Also, I give the custom workspace option as DEVELOP_BRANCH in the job configuration page of the respective job.

However, at the start of job, I get the following log information:

Building remotely on linux in workspace /data/home/jenkins/jenkins-slave/workspace/DEVELOP_BRANCH

I want to start my builds in this location.

/data/home/jenkins/jenkins-slave/DEVELOP_BRANCH

Why does the extra workspace directory come into the picture? How do I remove it? I do not have access to Jenkins master node. So, if there is a workaround that can match my requirements, it would be awesome.

Note: By node, I refer to a Linux OS computer with redHat distribution.

like image 803
Müller Avatar asked Jul 25 '16 05:07

Müller


People also ask

How do I change the default workspace in Jenkins?

So if you wish to change the Jenkins workspace, all you've do is change the path of your JENKINS_HOME. For slave nodes, specify the default workspace on the slave machine in the slave configuration under Manage Jenkins > Manage Nodes > > Configure > Remote FS root.

What is the default directory where a Jenkins build takes place?

Builds are stored in the Jenkins\jobs\[projectName]\builds\[build_id]\ directory. This is a directory managed by Jenkins and you (usually) do not need to modify anything in this directory.


1 Answers

In project configuration, under Advanced Project Options, you can check Use custom workspace and put a path there.

If you put an absolute path, it will be used without any extra workspace/ directory. (at least that's the behavior I can see on a windows server.)

like image 78
ben75 Avatar answered Oct 08 '22 02:10

ben75