所以,这是我用于在Jenkins中创建Jobs的我的pipelineJob()Jenkins DSL脚本,但是当我使用它时 轻量级 </跨度> ()在cpsScmFlowDefinition中,这个脚本不起作用,给我一个错误,我 () } } } SCRIPTPATH( ’’) 轻量级 </跨度> (true)//使用它时出错 } }}
错误:
处理提供的DSL脚本错误:(脚本,第14行)没有方法签名
我为解决这个问题所做的就是使用 的 cpsScmFlowDefinition() 强> 像这样:
pipelineJob('example') { definition { cpsScmFlowDefinition { scm { gitSCM { userRemoteConfigs { userRemoteConfig { credentialsId('') name('') refspec('') url('') } } branches { branchSpec { name('') } } extensions { cleanBeforeCheckout() localBranch { localBranch('') } } doGenerateSubmoduleConfigurations(false) browser { gitWeb { repoUrl('') } } gitTool('') } } scriptPath('') lightweight(true) } } }
尝试添加以下内容
pipelineJob('') { label('') definition { cpsScmFlowDefinition { scm { git { remote { url('') credentials('') } branch('') extensions { cleanBeforeCheckout() localBranch() } } } scriptPath('') configure { lightweight(true) } } } }