如何在"remoteJenkinsFileWorkflowMultiBranchProjectFactory"上下文中描述"remoteJenkinsFileSCM()"的值?



尝试定义一个时髦的dsl脚本来生成"Github组织文件夹"作业配置,使用"远程文件插件"来定义一个集中的Jenkinsfile

organizationFolder("${org}") {
description('This contains branch source jobs for Bitbucket and GitHub')
displayName("${org}")
triggers {
cron('@daily')
}
organizations {
github {
repoOwner("${org}")
credentialsId('myCreds')
apiUri('myGithubUr')
}
}
projectFactories {
remoteJenkinsFileWorkflowMultiBranchProjectFactory {
localFile('something')
remoteJenkinsFile('Jenkinsfile')
matchBranches(false)
remoteJenkinsFileSCM()
}
}
}

不确定在上面的代码中传递"remoteJenkinsFileSCM(("的值是什么,希望将"Git"作为配置中选择的选项。一个例子将非常有帮助和赞赏。

使用 UI 手动配置作业。然后查看作业的config.xml并将其转换为作业 DSL。XML 元素和作业 DSL 语法之间的映射应该非常相似。使用嵌入式作业 DSL API 查看器作为确切语法的参考。

远程文件插件页面包含手动配置作业的示例,请参阅 https://plugins.jenkins.io/remote-file。要获取config.xml,只需将config.xml添加到作业页面 URL,例如http://localhost:8080/job/example/config.xml.您需要使用 Chrome 才能查看该网页。

相关内容

  • 没有找到相关文章

最新更新