jenkinsjenkins-pluginsallure

Change the default allure-report path for allure jenkins configuration


In the jenkins configuration the default value for Report path is allure-report. Is there a way to change this default value? Allure default path

I want to change it to take the JOB_NAME parameter. I tried the following options and it doesn't work. While generating the allure report the command does not take the JOB_NAME parameter.

allure report generation command

My reason for changing the default value: I use a custom_workspace for some of the jenkins jobs, to do space management on the test server. I would like to keep the allure-report and allure-results separate for each job.


Solution

  • If you are using Groovy script, then you can provide your custom directories for the allure to serve the results as shown below:

    post {
    script {
                    allure([
                            includeProperties: false,
                            jdk: '',
                            properties: [],
                            reportBuildPolicy: 'ALWAYS',
                            results: [[path: '${WORKSPACE}/test-reports/report-1']]
                    ])
                }
        }