2017-10-13 1135 views
1

在腳本Jenkinsfile您設置構建通過設置「了流」項目引發:如何使用聲明式Jenkinsfile設置pipelineTriggers?

properties([ 
    pipelineTriggers([ 
     upstream(
      threshold: 'SUCCESS', 
      upstreamProjects: 'UpstreamJob\master' 
     ) 
    ]) 
]) 

如何在一個多分支管道作業中使用的聲明Jenkinsfile我設置了相當於pipelineTriggers?

如果我把pipelineTriggers在「選項」部分,我得到以下錯誤:

WorkflowScript: 20: Invalid option type "pipelineTriggers". Valid option types: [buildDiscarder, catchError, disableConcurrentBuilds, overrideIndexTriggers, retry, script, skipDefaultCheckout, skipStagesAfterUnstable, timeout, timestamps, waitUntil, withContext, withCredentials, withEnv, ws] 
+0

僅供參考,我們使用詹金斯2.73.1 –

回答

1

它不應該是在「選項」,但在「觸發器」部分。

嘗試:

pipeline { 
    triggers { 
     upstream (
      threshold: 'SUCCESS', 
      upstreamProjects: 'UpstreamJob\master' 
     ) 
    } 
} 
相關問題