Files
pw/init.groovy.d/20-allure.groovy
T

19 lines
717 B
Groovy

import jenkins.model.Jenkins
import ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation
import ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstaller
import hudson.tools.InstallSourceProperty
def jenkins = Jenkins.instance
def desc = jenkins.getDescriptorByType(AllureCommandlineInstallation.DescriptorImpl)
def existing = desc.getInstallations()
def alreadyConfigured = existing.any { it.name == "allure" }
if (!alreadyConfigured) {
def installer = new AllureCommandlineInstaller("2.29.0")
def prop = new InstallSourceProperty([installer])
def installation = new AllureCommandlineInstallation("allure", "", [prop])
desc.setInstallations(installation)
desc.save()
}