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

This issue is archived. You can view it, but you can't modify it. Learn more

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.
      

            Assignee:
            Richard Bywater
            Reporter:
            Kamil
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: