Jenkins Blue Ocean Workspace Path Too Long

We are using Jenkins Blue Ocean to build .Net applications for Windows 2012 r2 Jenkins Slaves. We use Jenkinsfile

git internally to define build pipelines.

With two projects, we get a build failure because the build path is too long for Windows to handle.
This usually happens with commands nuget pack

and npm install

, which maximize the maximum path.

The specified path, file name, or both are too long. 
The fully qualified file name must be less than 260 characters, 
and the directory name must be less than 248 characters.

script returned exit code 1

      

How can we not affect the length of the package paths of the Visual Studio Solution nuget package, how do we drop the workspace folder before what Windows can handle?


Thanks to Mutsa's suggestion, this is what we got in our Jenkins file:

pipeline {
agent {
    node {
        label 'win'
        customWorkspace "ws\\${JOB_NAME.replace("%2F", "_")}"
    }
}

      

This can be seen in the context of our core .net Wakeboard UK website repo on GitHub.

+3


source to share


2 answers


For a declarative pipeline, use the customworkace parameter to override the default path in the node, docker, or docker section of the file. See example.

agent {
node {
    customWorkspace '/some/other/path'
}

      



This can be a relative path relative to the workspace root or an absolute path.

0


source


You can always customize the workspace path and point to the directory



0


source







All Articles