在Jenkins管道中压缩目录
我经常遇到这样的错误:“没有方法的签名:zip.call()” 这是我在Jenkins管道中运行的代码:在Jenkins管道中压缩目录,jenkins,groovy,jenkins-pipeline,Jenkins,Groovy,Jenkins Pipeline,我经常遇到这样的错误:“没有方法的签名:zip.call()” 这是我在Jenkins管道中运行的代码: pipeline { agent any stages { stage("test..") { steps { zip dir: '', glob: '', zipFile: 'testz.zip' } } } } 我已经在管道语
pipeline {
agent any
stages {
stage("test..")
{
steps
{
zip dir: '', glob: '', zipFile: 'testz.zip'
}
}
}
}
我已经在管道语法的示例步骤中显示了zip步骤,所以不确定为什么失败。我需要压缩我的源代码文件夹
管道实用程序步骤插件已安装:
尝试用
脚本{}
pipeline {
agent any
stages {
stage("test..") {
steps {
script {
zip dir: '', glob: '', zipFile: 'testz.zip'
}
}
}
}
}
试试这个:
pipeline {
agent any
stages {
stage("test.."){
steps{
script{
zip archive: true, dir: '', glob: '', zipFile: 'testz.zip'
}
}
}
}
}
参考资料:您是否安装了“管道实用程序步骤”插件?是的,上面添加了图片