Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/jenkins/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Jenkins管道中压缩目录_Jenkins_Groovy_Jenkins Pipeline - Fatal编程技术网

在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' } } } } 我已经在管道语

我经常遇到这样的错误:“没有方法的签名:zip.call()”

这是我在Jenkins管道中运行的代码:

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'
             }
          }
       }
    }
}

参考资料:

您是否安装了“管道实用程序步骤”插件?是的,上面添加了图片