Answers: <p>You should add export script (bash script which does exporting html files produced to the place they belong) after Cucumber Reports plugin step, as it should be used by job runned either solely or by pipeline.</p>
  
Answers: CC BY-SA 3.0
Answers: 2017-06-11T04:52:01.717Z
Answers: Can you explain further? What export script?
Answers: lawnmowerlatte
Answers: CC BY-SA 3.0
Answers: 2017-06-12T01:18:02.693Z
Answers: @lawnmowerlatte added to answer.
Answers: chupasaurus
Answers: CC BY-SA 3.0
Answers: 2017-06-10T03:02:57.633Z
Answers: 2017-06-12T01:17:17.290Z
Answers: 2017-06-12T01:17:17.290Z
Answers: chupasaurus
Answers: <p>Working off what @chupasaurus said, here's what I came up with:</p>
  
  <pre><code>node('master') {
      dir("../builds/${BUILD_NUMBER}/") {
          sh "cp -r cucumber-html-reports $WORKSPACE"
      }
  
      archive "cucumber-html-reports/*"
  }
  </code></pre>
  
  <p>Obviously all this does is archive the report for that build, but you can easily extend this to copy it somewhere else where it can be hosted or manipulated. Just make sure you put this after the Cucumber Reports plugin step.</p>
  
Answers: CC BY-SA 3.0
Answers: 2017-06-13T16:54:44.800Z
Answers: 2017-06-13T16:54:44.800Z
Answers: lawnmowerlatte
Body: <p>I'm using the Cucumber Reports Plugin for Jenkins and I want to be able to export the HTML reports so they can be posted on an external portal. I can see that there is a folder named <code>cucumber-html-reports</code> in the build directory in Jenkins, but how do I access this? Is there some way to access these files from within a pipeline?</p>
  
Comments: CC BY-SA 4.0
Comments: 2019-03-12T03:44:42.987Z
Comments: @AnkitSuhane That script is a Jenkins scripted pipeline (https://jenkins.io/doc/book/pipeline/syntax/#scripted-pipeline), but it could be executed as a Shell step and an Archive step in a regular freestyle build.
Comments: lawnmowerlatte
Comments: CC BY-SA 4.0
Comments: 2019-01-17T16:15:10.217Z
Comments: Many Thanks for your response.
  May I know how to execute this code as in whether i have to feed it in jenkins job or i have to create a file with any specific extension and run? node('master') { dir("../builds/${BUILD_NUMBER}/") { sh "cp -r cucumber-html-reports $WORKSPACE" } archive "cucumber-html-reports/*" } Please help
Comments: Ankit Suhane
Tags: <jenkins><jenkins-plugins><testing><jenkins-pipeline>
Title: How to export Cucumber Reports via Jenkins Pipeline
UserDisplayName: lawnmowerlatte
ThreadText: # How to export Cucumber Reports via Jenkins Pipeline
  
  (Asked by: username_0 on 2017-06-09)
  
  I'm using the Cucumber Reports Plugin for Jenkins and I want to be able to export the HTML reports so they can be posted on an external portal. I can see that there is a folder named `cucumber-html-reports` in the build directory in Jenkins, but how do I access this? Is there some way to access these files from within a pipeline?
  
  **Tags:** jenkins, jenkins-plugins, testing, jenkins-pipeline
  
  > **Comments:**
  > **username_1**: Many Thanks for your response. May I know how to execute this code as in whether i have to feed it in jenkins job or i have to create a file with any specific extension and run? node('master') { dir("../builds/${BUILD_NUMBER}/") { sh "cp -r cucumber-html-reports $WORKSPACE" } archive "cucumber-html-reports/*" } Please help  
  > **username_0**: @username_1 That script is a Jenkins scripted pipeline (https://jenkins.io/doc/book/pipeline/syntax/#scripted-pipeline), but it could be executed as a Shell step and an Archive step in a regular freestyle build.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2017-06-13. Score: 3 | Accepted answer
  
  Working off what @username_2 said, here's what I came up with:
  
  ```
  node('master') {
      dir("../builds/${BUILD_NUMBER}/") {
          sh "cp -r cucumber-html-reports $WORKSPACE"
      }
  
      archive "cucumber-html-reports/*"
  }
  
  ```
  
  Obviously all this does is archive the report for that build, but you can easily extend this to copy it somewhere else where it can be hosted or manipulated. Just make sure you put this after the Cucumber Reports plugin step.
  
  
  ---
  
  ### Answer by username_2 on 2017-06-10. Score: 1
  
  You should add export script (bash script which does exporting html files produced to the place they belong) after Cucumber Reports plugin step, as it should be used by job runned either solely or by pipeline.
  
  > **Comments:**
  > **username_0**: Can you explain further? What export script?  
  > **username_2**: @username_0 added to answer.  
  
  ---
  
  