0

たとえば、宣言的構文を使用してマルチブランチパイプラインで使用するようにNotification pluginを設定したいとします。 ようなコードを提供してくれ、その目的のためにsnippet generatorあります:Jenkinsのマルチブランチパイプラインで作成されたジョブを宣言構文を使用して構成する方法は?

properties([ 
    [ 
     $class:'HudsonNotificationProperty', 
     endpoints:[ 
     [ 
      urlInfo:[ 
       urlOrId:'https://example.com/smth', 
       urlType:'PUBLIC' 
      ] 
     ] 
     ] 
    ], 
    pipelineTriggers( [ 

    ] ) 
]) 

私はそれがScripted Pipeline構文で書かれていると信じています。 Declarative Pipeline構文を使用して、これを私のプロジェクトにどのように統合できますか?

答えて

0

あなたの特性は前にパイプラインを宣言スニペット貼り付けます。

#!/usr/bin/env groovy 

properties([[$class: 'HudsonNotificationProperty', 
    endpoints: [[urlInfo: [urlOrId: 'https://foo.bar.com', urlType: 'PUBLIC']]]]] 
) 

pipeline { 
... 
} 
関連する問題