How does one run allure plugin in jenkins pipeline?

Etki picture Etki · Nov 2, 2016 · Viewed 15.8k times · Source

I'm building pipeline/jenkins-based CI for several projects and want to store allure results just as it would be done in regular build with fast access icon. Is it possible from pipeline?

Answer

RocketRaccoon picture RocketRaccoon · Nov 18, 2016

We were failed to use Allure Jenkins Plugin in pipeline. It seems that it supports job-dsl-plugin only. So... just add stage where you generate report using Allure CLI and publish report as regular HTML report. Icon for it will be available on job and build screen.

UPDATE

Allure v2 has supported pipeline - see documentation.

stage('reports') {
    steps {
    script {
            allure([
                    includeProperties: false,
                    jdk: '',
                    properties: [],
                    reportBuildPolicy: 'ALWAYS',
                    results: [[path: 'target/allure-results']]
            ])
    }
    }
}