j3r*_*3m7 6 windows jenkins .net-core jenkins-pipeline jenkins-blueocean
我们正在使用Jenkins Blue Ocean在Windows 2012 r2 Jenkins Slaves上构建.Net应用程序.我们Jenkinsfile在git repos中使用一个来定义构建管道.
由于工作区构建路径太长而Windows无法处理,因此有几个项目会导致构建失败.
这通常发生在最大路径上的命令nuget pack和npm install命令.
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
Run Code Online (Sandbox Code Playgroud)
由于我们不能影响Visual Studio解决方案nuget包路径的长度,我们如何将工作区文件夹放到Windows可以处理的东西?
感谢Mutsa的建议,这是我们在Jenkinsfile中得到的结果:
pipeline {
agent {
node {
label 'win'
customWorkspace "ws\\${JOB_NAME.replace("%2F", "_")}"
}
}
Run Code Online (Sandbox Code Playgroud)
这可以在我们的.net核心Wakeboard英国网站回购 GitHub 上下文中看到.
小智 3
对于声明性管道,请使用customworksace选项覆盖节点、docker 或 dockerfile 部分中的默认路径。参见示例。
agent {
node {
customWorkspace '/some/other/path'
}
Run Code Online (Sandbox Code Playgroud)
它可以是相对于工作空间根目录的相对路径或绝对路径。
| 归档时间: |
|
| 查看次数: |
1500 次 |
| 最近记录: |