Skip to content

Instantly share code, notes, and snippets.

@sskjames
Created October 17, 2017 06:52
Show Gist options
  • Save sskjames/96e0da6ad9ecd7ab926571dc0d4c8ca1 to your computer and use it in GitHub Desktop.
Save sskjames/96e0da6ad9ecd7ab926571dc0d4c8ca1 to your computer and use it in GitHub Desktop.
Multi module Spock reports in Jenkins Pipeline
sh 'mkdir spock-reports'
sh 'cp **/target/spock-reports/com.* spock-reports/.'
sh '''
for dir in $(find . -mindepth 1 -maxdepth 1 -type d)
do
file=$dir/target/spock-reports/index.html
if [ -f "$file" ]
then
cp $file spock-reports/$dir-index.html
fi
done'''
publishHTML(target: [allowMissing: true, alwaysLinkToLastBuild: false, keepAll: true, reportDir: 'spock-reports', reportFiles: '*index.html', reportName: 'Spock Report', reportTitles: ''])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment