2017-07-03 68 views
1

我當作業創建它默認爲創建每次構建一個標籤添加addtional行爲工作的DSL如下詹金斯禁用標籤每個構建DSL

pipelineJob('demo/Development') { 
    definition { 
    cpsScm { 
     scm { 
       git('https://github.com/demo/demo.git','development') 
     } 
     scriptPath('Jenkinsfile') 
    } 
} 
} 

。我怎樣才能在dsl工作上禁用這個功能?

回答

0

管理來解決問題

git('https://github.com/demo/demo.git','development',{node -> node/'extensions' << '' }) 

只需要添加的配置塊擺脫擴展塊,如果需要的話也可以用來直接修改XML。

0

另一個選項(如Jenkins Job DSL 1.64)是添加一個空配置塊。如果你需要爲SCM設置其他值,例如:

pipelineJob('DSL_Pipeline') { 

    def repo = 'https://github.com/path/to/your/repo.git' 

    triggers { 
    scm('H/5 * * * *') 
    } 
    description("Pipeline for $repo") 

    definition { 
    cpsScm { 
     scm { 
     git { 
      remote { url(repo) } 
      branches('master', '**/feature*') 
      scriptPath('misc/Jenkinsfile.v2') 
      extensions { } 
     } 

     } 
    } 
    } 
} 

http://job-dsl.herokuapp.com/是砍在DSL,並找出哪些工作的一個有用工具,這非常有用。