2016-03-03 29 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個插件不兼容:( –

相關問題