我在附加多个附件时遇到问题。这些附件具有不同的格式。我已经尝试过用空格分隔附件模式。
emailext(
attachLog: true,
body: "xxxxxxxxxxxxxx",
attachmentsPattern: '**/*.fpr; **/testing.txt',
compressLog: true,
subject:.........."
to: '......'
)
最佳答案
在单引号内使用逗号分隔我通过模式“test/forEmail*, test/myPdf3*”附加了多个文件:
emailext attachmentsPattern: 'test/forEmail*, test/myPdf3*', body: '''${SCRIPT, template = "emailTest1-html.template"}''', mimeType: 'text/html', replyTo: '<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="177376637a7e7b2657717865733974787a" rel="noreferrer noopener nofollow">[email protected]</a>', subject: 's1', to: '<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="acdec6c3c2c99a989aeccac3dec882cfc3c1" rel="noreferrer noopener nofollow">[email protected]</a>'
原答案:
If you don't want to change your file names to fit a single pattern, you can copy files to a single folder in your workspace then send everything in the folder.
For example, I copied all files that I want to email to a folder called test, then I sent everything in that folder with the pattern 'test/*'
emailext attachmentsPattern: 'test/*',body: '''${SCRIPT, template = "emailTest1-html.template"}''', mimeType: 'text/html', replyTo: '[email protected]', subject: 's1', to: '[email protected]'
如果您需要如何在 Windows 托管的 jenkins 中复制文件的示例:
block 引用>bat "copy \"C:\Program Files (x86)\Jenkins\jobs\${env.JOB_BASE_NAME}\builds\${env.BUILD_NUMBER}\htmlreports\Test_20Automation_20Report\TestExecutionReport_SL MIL.html\" test\TestExecutionReport_SL_MIL.html"
关于Jenkins emailext 多个附件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51390078/