我有一个多分支管道,该管道是在脚本管道(来自库)中定义的,可以协调约100个构建,每个构建都跨越多个从属(不同的操作系统)。 Windows是操作系统之一,它具有255个字符的路径限制。因为我们的某些作业中有〜200个字符路径(我们无法控制,因为这是供应商提供的地狱),所以我需要更改Windows从站上的step / node工作区,最好是使用node()进行更改步骤,这样git只会自动签出一次到自定义工作区中。
我尝试了各种样式:
这在声明性管道中有效:
stage('blah') {
node {
label 'win'
customWorkspace "c:\\w\\${JOB_NAME"
}
steps {
...
}
}
但是我找不到脚本管道的等效项:
pipeline {
stage('stage1') {
node('win-node') {
// the git repository is checked out to ${env.WORKSPACE}, but it's unusable due to the path length issue
ws("c:\\w\\${JOB_NAME}") {
// this switches the workspace, but doesn't clone the git repo again
body()
}
}
}
}
理想情况下,我想要这样的东西:
pipeline {
stage('stage1') {
node('win-node', ws="c:\\w\\${JOB_NAME}") {
body()
}
}
}
有什么建议吗?