关于詹金斯(Jenkins)产生NAN%的魅力报告,并且报告URL为空

时间:2020-05-19 23:10:52

标签: javascript jenkins allure

关于詹金斯产生NAN%的诱人报告,并且报告URL为空。我在下面有一个管道,它正在URL / null /上生成报告。在我在目录中添加$ {env.HOME}之前,它工作正常。但是现在不起作用

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']]
              ])
            }
          }
        }

}  

它说在以下位置产生了吸引力报告:

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.

1 个答案:

答案 0 :(得分:1)

您正在使用工作空间内的dir("${env.HOME}/app"){...}创建目录。因此,魅力未找到结果,您可以执行以下操作:

检查路径是否正确,但这是一个示例:

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