简体   繁体   中英

How to use Java variables in Jenkins

I have Jenkins job which run auto tests on server and send result to email in html formt. HTML report page copied to ftp using comands

robocopy \\\\%vm%\\TEST_AT\\AT-Tool_%build% .\\TA\\ *.html *.version /NFL /R:1 robocopy "\\\\%vm%\\TEST_AT\\AT-Tool_%build%\\report" "\\\\ftp\\ftp\\Projects\\TA\\CI-results\\cd%drop%_patch\\%BUILD_NUMBER%" /E

HTML report contains links to png images like:

file://ftp/ftp/Projects/TA/CI-results/cd14_patch/185/detailed_report_2-TC__dataset1/pages/screenshots/screen-thread-24-1420740565855.png

HTML report is generated by Java code and images path is a variable

I need to attach this .png files in email with HTML report which send my Jenkins job.

Is it possible to improve my Jenkins job for sending email with such attachments?

You can add a post build step in Jenkins witch will create a ZIP archive.

I my project I'm using shell script for it:

zip -r ${reports_version}.zip docs source

And for e-mail you can use jenkins e-mail ext plugin https://wiki.jenkins-ci.org/display/JENKINS/Email-ext+plugin

It allows you to attache files to e-mail notifications.

Hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM