emailext jenkinsfile附件自述文件

时间:2017-07-21 09:33:58

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

试图让jenkins将自述文件包含为管道附件

stage('email Alex!'){
      mail(
          body: 'your component is released',
          attachmentsPattern: '**/*.md',
          from: env.DEFAULT_REPLYTO,
          replyTo: env.DEFAULT_REPLYTO,
          subject: 'README',
          to: 'alexander.lovett@bt.com'
      )
  }

在这个测试中,dir结构是:

--currentDir
  |--Project
     |--README.md

我刚收到一封关于身体的电子邮件但没有附件:/ 有谁知道怎么做?

1 个答案:

答案 0 :(得分:1)

你应该安装这个插件:

https://wiki.jenkins.io/display/JENKINS/Email-ext+plugin

用这个替换你的代码:

stage('email Alex!'){
   emailext(
      body: 'your component is released',
      attachmentsPattern: '**/*.md',
      from: env.DEFAULT_REPLYTO,
      replyTo: env.DEFAULT_REPLYTO,
      subject: 'README',
      to: 'alexander.lovett@bt.com'
   )
}