2016-03-03 62 views
0

我使用Join Plugin创建只有在多个作业完成后才能运行的作业。但是,在配置加入任务时,我似乎无法找到一种方法来声明仅在下游作业的子集已完成之后运行的联接。Jenkins加入仅包含下游作业子集的插件

就拿下面的管道:

Sample pipeline

setup-deployment是一个连接是已经完成了由build-core引发的所有任务后运行任务。假设我想创建一个新任务build-artifacts,这个任务仅取决于第二列任务sonar-appcobertura-app的完成情况。这可能使用Join插件或其他类似的插件吗?

回答

0

我想你可以用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) }, 
) 

结果:

enter image description here

+0

它看起来像构建流程插件不与交货流水线插件相处(我用于可视化)。 –

+0

行我不知道这2个插件不兼容:( –

相关问题