我有一个创建工作的DSL
脚本。一旦我运行作业,config.xml
就会改变。因此,当我再次运行种子作业时,作业不会得到更新。
我怀疑有些插件会这样做。你能告诉我在工作运行时找出配置变更的最佳方法吗?
[
[name: "Sonar/co", repo: "repo.git", pomPath: "pom.xml", branch: "development", mvnGoal: "-am -P dev -pl project clean test"]
].each { Map config ->
mavenJob(config.name) {
description "Sonar job für ${config.name}"
logRotator {
numToKeep(1)
}
label "sonar"
scm {
git {
branch "*/${config.branch}"
remote {
url "git@repository:${config.repo}"
}
browser {
gitLab("https://gitlab.DOMAIN.de/", "9.0")
}
}
}
mavenInstallation "maven339"
goals config.mvnGoal
rootPOM config.pomPath
configure { node ->
node / settings (class: 'jenkins.mvn.DefaultSettingsProvider') {
}
node / globalSettings (class: 'jenkins.mvn.DefaultGlobalSettingsProvider') {
}
}
}
}