Jenkins Join 插件仅包含下游作业的子集
Jenkins Join plugin with only a subset of the downstream jobs
我正在使用 Join Plugin 创建仅在多个作业完成后才应 运行 的作业。但是,在配置连接任务时,我似乎无法找到一种方法来声明应该 运行 在下游作业的 一个子集 完成之后。
以下面的管道为例:
setup-deployment
是在build-core
触发的所有任务完成后运行的join任务。假设我想创建一个新任务 build-artifacts
,它仅取决于第二列中任务 sonar-app
和 cobertura-app
的完成情况。是否可以使用 Join 插件或其他类似插件?
我认为您可以通过 Jenkins Build Flow plugin 实现。
如果你必须设计复杂的工作流程,这个插件真的很强大。
这是我的构建流程之一的示例:
// Format the build ID (long and short)
TimeZone.setDefault(TimeZone.getTimeZone('UTC'))
def now = new Date()
def short_date = now.format("yyyyMMdd")
def long_date = now.format("yyyyMMdd_HHmm")
// Launch the OpenDJ nightly build (try 3 times if random test failures)
ignore(UNSTABLE) {
retry (3) {
build("OpenDJ_-_nightly_-_build", BUILD_ID_SHORT: short_date, BUILD_ID_LONG: long_date)
}
}
// Build the standard packages
parallel (
{ build("OpenDJ_-_nightly_-_DEB", BUILD_ID_SHORT: short_date, BUILD_ID_LONG: long_date) },
{ build("OpenDJ_-_nightly_-_RPM", BUILD_ID_SHORT: short_date, BUILD_ID_LONG: long_date) },
{ build("OpenDJ_-_nightly_-_MSI", BUILD_ID_SHORT: short_date, BUILD_ID_LONG: long_date) },
{ build("OpenDJ_-_nightly_-_ZIP_OEM", BUILD_ID_SHORT: short_date, BUILD_ID_LONG: long_date) }
)
// Build the DEB and RPM OEM packages (they depend on the previous builds)
parallel (
{ build("OpenDJ_-_nightly_-_DEB_OEM", BUILD_ID_SHORT: short_date, BUILD_ID_LONG: long_date) },
{ build("OpenDJ_-_nightly_-_RPM_OEM", BUILD_ID_SHORT: short_date, BUILD_ID_LONG: long_date) },
)
结果:
我正在使用 Join Plugin 创建仅在多个作业完成后才应 运行 的作业。但是,在配置连接任务时,我似乎无法找到一种方法来声明应该 运行 在下游作业的 一个子集 完成之后。
以下面的管道为例:
setup-deployment
是在build-core
触发的所有任务完成后运行的join任务。假设我想创建一个新任务 build-artifacts
,它仅取决于第二列中任务 sonar-app
和 cobertura-app
的完成情况。是否可以使用 Join 插件或其他类似插件?
我认为您可以通过 Jenkins Build Flow plugin 实现。
如果你必须设计复杂的工作流程,这个插件真的很强大。
这是我的构建流程之一的示例:
// Format the build ID (long and short)
TimeZone.setDefault(TimeZone.getTimeZone('UTC'))
def now = new Date()
def short_date = now.format("yyyyMMdd")
def long_date = now.format("yyyyMMdd_HHmm")
// Launch the OpenDJ nightly build (try 3 times if random test failures)
ignore(UNSTABLE) {
retry (3) {
build("OpenDJ_-_nightly_-_build", BUILD_ID_SHORT: short_date, BUILD_ID_LONG: long_date)
}
}
// Build the standard packages
parallel (
{ build("OpenDJ_-_nightly_-_DEB", BUILD_ID_SHORT: short_date, BUILD_ID_LONG: long_date) },
{ build("OpenDJ_-_nightly_-_RPM", BUILD_ID_SHORT: short_date, BUILD_ID_LONG: long_date) },
{ build("OpenDJ_-_nightly_-_MSI", BUILD_ID_SHORT: short_date, BUILD_ID_LONG: long_date) },
{ build("OpenDJ_-_nightly_-_ZIP_OEM", BUILD_ID_SHORT: short_date, BUILD_ID_LONG: long_date) }
)
// Build the DEB and RPM OEM packages (they depend on the previous builds)
parallel (
{ build("OpenDJ_-_nightly_-_DEB_OEM", BUILD_ID_SHORT: short_date, BUILD_ID_LONG: long_date) },
{ build("OpenDJ_-_nightly_-_RPM_OEM", BUILD_ID_SHORT: short_date, BUILD_ID_LONG: long_date) },
)
结果: