2016-12-10 100 views
1

在詢問此問題之前,我試着查看Jenkins管道文檔,更重要的是看到issue JENKINS-38442Jenkins管道 - 僅在最後階段合併的並行階段

我想創建一個管道,看起來像這樣: Modified screenshot

基本上,我想並行階段在不同的階段,而不是下一階段本身合併。這可能嗎?

我能做到目前爲止最好的僅僅是這樣的:Original Screenshot

下面是產生上述管道的管道代碼:

node { 
    def staticTests = [:] 
    staticTests["unit tests"] = {stage('unit'){ }} 
    staticTests["static analysis"] = {stage('static'){ }} 

    def tests = [:] 
    tests["functional"] = {stage('functional'){}} 
    tests["performance"] = {stage('performance'){}} 
    tests["security"] = {stage('security'){}} 

    stage('prepare'){} 
    stage('tests'){parallel(staticTests)} 
    stage('build'){} 
    stage('int'){} 
    stage('regression'){} 
    stage('qa'){} 
    stage('tests'){ parallel(tests) } 
    stage('prod'){} 
} 

什麼樣的變化將幫助我創造流水線根據需要在上面粘貼修改後的截圖?詹金斯管道今天甚至有可能嗎?預先感謝您的幫助!

回答

1

那麼你可以寫

node { 
    stage('prepare') {} 
    parallel main: { 
    stage('unit tests') {} 
    stage('build') {} 
    stage('int') {} 
    stage('regression') {} 
    stage('qa') {} 
    parallel functional: {}, performance: {}, security: {} 
    }, 'static analysis': {} 
    stage('prod') {} 
} 

這將運行您請求(如果我理解正確的話),但藍海目前不能在細節的適當水平,以顯示它,注意方式在JENKINS-38442。