詹金斯:无法通过电子邮件发送zip存档

时间:2017-11-04 18:38:47

标签: jenkins gitlab jenkins-pipeline jenkins-email-ext

我想从GitLab获取项目源代码,将其存档并通过电子邮件发送。

Jenkinsfile:

def gitlabRepo = 'http://repository.vrpconsulting.com/roman.skaskevich/koshcheck-copy.git'
deleteDir()
dir('koshcheck-copy') {
    stage 'Fetch'
    def curdir = pwd()
    echo curdir
    git url: "${gitlabRepo}", branch: 'master'

    stage 'Archive'
    zip archive: true, dir: './src', glob: '', zipFile: 'src.zip'
    def savedZip = archive 'src.zip'
    echo savedZip

    stage 'Notify'
    emailext (
        to: 'roman.skaskevich@gmail.com',
        subject: "ZIP",
        body: "Attached zip must be there",
        attachmentsPattern: 'src.zip'
    )
}

我不知道项目是否已成功存档,但不会通过电子邮件发送。

编辑#1

问题在于没有创建存档。所以我执行运行本地7zip for create archive的命令:bat "\"C:\\Program Files (x86)\\7-Zip\\7z.exe\" a -tzip src.zip src"

现在仍然是通过电子邮件发送此存档的问题。因为工作成功完成,但返回了:

  

发送电子邮件至:roman.skaskevich@gmail.com

     

发送到以下VALID地址时出错:roman.skaskevich@gmail.com

我发现this article表明附件太大了。但是我将存档的大小从7MB减少到250kB并且存在同样的问题。

提前致谢!

0 个答案:

没有答案
相关问题