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?
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.
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.
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.
Disable concurrent builds in Jenkins declarative pipeline. Define disableConcurrentBuilds option to disallow concurrent executions.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With