1

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.

Bustaq
  • 159
  • 8

1 Answers1

0

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/
Altaf
  • 2,838
  • 1
  • 16
  • 8
  • after running the cp cmd as above. Got this error. CP: cannot stat ' /apps/jenkins/cloudbees-data/jobs/DSO_TEST/jobs/dso_automation_ete_test/builds/56/htmlreports/*': NO SUCH FILE or DIRECTORY – Bustaq Jul 13 '21 at 11:15
  • @Bustaq do you see the files in the directory manually? – Altaf Jul 13 '21 at 11:45
  • I was running my test from Jenkins node A, I could find that html publisher publishing reports to Jenkins master node. I was expecting that html publisher would generate html file with inline CSS, so planning to take out the html file only. But in the published folder has the CSS,js as external stylesheet . My required is to attached inline html file. – Bustaq Jul 14 '21 at 15:03