Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-64771

Jenkins pipeline - HTML Publusher stage/step show success but it's failed

XMLWordPrintable

      HTML Publisher may fail due to non existing source and/or target directory, the console log will then show an error, but the stage will be marked as succeeded. It leads to failed pipeline (which is correct), but all stages/steps are marked as succeded. It makes the debugging very difficult to find the problem.

       

       

      example
      stage('Generage and Build') {
          parallel {
              stage('regular step') {
                  steps {
                      bat 'do stuff'
                  }
              }
              stage('publish results') {
                  steps {
                      dir('C:/fancy/path') {
                          dir('c:/another/fancy/path') {
                              bat 'echo Creating Directory c:/another/fancy/path'
                          }
                          bat 'run_my_script.bat'
                          publishHTML([
                                  allowMissing         : false,
                                  alwaysLinkToLastBuild: false,
                                  keepAll              : false,
                                  reportDir            : 'c:\\GeneratedOutput\\pandocOutput\\HTML',
                                  reportFiles          : 'index.html',
                                  reportName           : 'my report name',
                                  reportTitles         : 'my report titles'
                          ])
                      }
                  }
              }
          }
      }

      @EDIT
      Here is the console log

      [htmlpublisher] Archiving HTML reports...
      [htmlpublisher] Archiving at BUILD level O:\GeneratedOutput\pandocOutput\HTML to D:\Jenkins\Jenkins.jenkins\jobs\test\builds\86\htmlreports\OPAR_20Documentation_20CoPm
      ERROR: Specified HTML directory 'O:\GeneratedOutput\pandocOutput\HTML' does not exist.
      

            r2b2_nz Richard Bywater
            wintermute Kamil
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: