Html plublisher - Could not copy html report to other path within workspace

882 views Asked by At

Trying to copy the HTML publisher report to another path in same workspace.

Added below script in jenkinsfile

  publishHTML([allowMissing: false, alwaysLinkToLastBuild: false,includes: '**/*.png', keepAll: true, reportDir: target/cucumber-html-reports', reportFiles: report.html', reportName: 'HTMLReport', reportTitles: ''])

Jenkins Console log

    [htmlpublisher] Archiving HTML reports...

    [htmlpublisher] Archiving at BUILD level /apps/cloudbees-je/cloudbees-data/workspace/TEST/all_test/target/cucumber-html-reports to    /apps/jenkins/cloudbees-data/jobs/TEST/jobs/all_test/builds/42/htmlreports/HTMLReport

I am trying to copy the HTML publisher output “/apps/jenkins/cloudbees-data/jobs/TEST/jobs/all_test/builds/42/htmlreports/HTMLReport" To ${env.WORKSPACE}/report by running below script in jenkinsfile

   sh "cp /apps/jenkins/cloudbees-data/jobs/TEST/jobs/all_test/builds/42/htmlreports/HTMLReport ${env.WORKSPACE}/report/"

ERROR :

   cp: cannot stat ‘/apps/jenkins/cloudbees-data/jobs/DSO_TEST/jobs/dso_automation_ete_test/builds/46/htmlreports/HTMLReport’: No such file or directory

Any Suggestion to copy the HTML publisher report to another path.Not understanding why o could not see an files in the HTMl publisher reported path.

1

There are 1 answers

3
Altaf On

You must check if all files are available at the defined location.
You can then do a copy command using :

cp /apps/jenkins/cloudbees-data/jobs/DSO_TEST/jobs/dso_automation_ete_test/builds/46/htmlreports/* ${env.WORKSPACE}/report/