Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the concurrent build path separator in Jenkins

Tags:

jenkins

When marking a job as able to run concurrently on the same node, Jenkins will append a @X (where X is the number of the concurrent build) to the normal workspace directory to get a new, unique workspace directory. Normally, this is all fine and good, but we've encountered a couple tools that cannot handle a @ in the path name even though the operating system can.

Is there some way to change the @ character to something else? Say maybe a double underscore (__) or something?

like image 579
Jason Swager Avatar asked Nov 01 '12 01:11

Jason Swager


People also ask

How do I change the Jenkins workspace path?

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.

How do I allow concurrent builds in Jenkins?

Concurrent builds are enabled by default. That is why the is the disableConcurrentBuilds() function. So there is no need to add any additional code to your pipeline to enable concurrent builds.

How do I change the directory in Jenkins pipeline script?

dir : Change current directory Change current directory. Any step inside the dir block will use this directory as current and any relative path will use it as base path. The relative path of the directory in the workspace to use as a new working directory.

Do not allow concurrent builds in Jenkins?

Disable concurrent builds in Jenkins declarative pipeline. Define disableConcurrentBuilds option to disallow concurrent executions.


2 Answers

This thread may help: http://jenkins.361315.n4.nabble.com/Concurrent-executions-and-workspace-names-td4631221.html

... I can do this with a system property. I believe -Dhudson.slaves.WorkspaceList="=" will do the trick.

Using https://wiki.jenkins-ci.org/display/JENKINS/Throttle+Concurrent+Builds+Plugin The Throttle Concurrent Builds plugin might also help.

like image 96
Lee Ballard Avatar answered Oct 12 '22 14:10

Lee Ballard


As I am not allowed to comment Lees answer here is my modified answer his

use -Dhudson.slaves.WorkspaceList==

otherwise it will build the project in [JENKINS]/workspace/myProject"="2

like image 42
Eric Avatar answered Oct 12 '22 13:10

Eric