I have Jenkins set up to run builds on a windows slave.
In an older version of Jenkins (2.7 to be exact), the builds ran fine under
C:\jenkins\workspace\<repository name>\<project name>\<stage>
However when we upgraded (now using 2.19.3), the builds are now under
C:\jenkins\workspace\<a concatenation of repository, project, stage and a *very* long alphanumeric string>
This causes problems in my build as filepaths are becoming too long to handle and various steps are breaking. In fact, even the default folder name is so long that the beginning of the name is being truncated.
There are Linux agents under this Jenkins master so I cannot do a blanket workspace change on all agents.
How can I proceed? Is it possible to change this default folder name to something shorter?
Make sure you understand what is the disk output of your build - if possible - restrict the output to happen only to the job workspace. Use workspace cleanup plugin to cleanup the workspace as post build step. If the process must write some data to external folders - clean them up manually on post build steps.
So far, our solution has been a rather hacky one:
We simply mapped the long base folder to a network drive (specifically:
subst x: .
x:
and then continued on from there.
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