简体   繁体   中英

Allure report on Jenkins producing NAN% and null report URL

Allure report on Jenkins producing NAN% and null report URL. I have a pipeline below and it is generating the report on the URL /null/. It was working fine before my added ${env.HOME} in my directories. But now it does not work

pipeline {

    agent {
        label {
            label ""
            customWorkspace "${env.HOME}/test"
        }
    }


  tools {nodejs "node"}

  stages {
        stage('Checkout App') {
            steps {
                dir("${env.HOME}/app") {
                echo "Building.."
                sh 'git pull'
                }
                // build shopfloor app
                dir("${env.HOME}/app") {
                sh "/${env.HOME}/test/App.sh"
                } 
            }
        }


    }

        post('Publish Report') {
          always {
            script {
              allure([
                includeProperties: false,
                jdk: '',
                properties: [],
                reportBuildPolicy: 'ALWAYS',
                results: [[path: 'target/allure_results']]
              ])
            }
          }
        }

}  

It says allure report generated on:

allure-results does not exists
Report successfully generated to /Users/john/.jenkins/null/test/allure-report
Allure report was successfully generated.
Creating artifact for the build.
Artifact was added to the build.

You are creating a directory with dir("${env.HOME}/app"){...} inside the workspace. For that reason, allure didn't find the results, you could do something like this:

Check if the path is correct, but this will be an example:

results: [[path: '$WORKSPACE/${env.HOME}/app/target/allure_results']]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM