jenkins - Jenkins 管道声明性语法配置 checkout scm(特定于路径的构建触发器)
问题描述
我正在使用 Jenkins 管道(声明性语法),并希望将管道配置为使用 scm 触发器,因此只有在部分 git repo 发生更改时才会运行构建。
我查看了(管道插件)[ https://support.cloudbees.com/hc/en-us/articles/226122247-How-to-Customize-Checkout-for-Pipeline-Multibranch-]文档,示例似乎用于脚本文件语法。下面的评论说它也适用于 dsl,但找不到合适的示例用法。
查看管道日志,我看到了一个获取提交的自动步骤。
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Declarative: Checkout SCM)
[Pipeline] checkout
那么这是自动完成的吗?
我尝试了以下步骤,这似乎同步了代码。
stage("Checkout ") {
steps {
checkout(scm)
}
}
但不知道如何使它适用于我的用例,即确保管道仅在源存储库中的特定路径发生更改时运行,例如这里的includeRegion https://jenkins.io/doc/pipeline/steps/workflow-scm -步/。
解决方案
推荐阅读
- python - 在 Nodejs 中预加载 python 库
- ibm-mq - ibm mq 在 solaris 上的日志文件位于何处
- python - 我的函数的数学结果是错误的,我不知道为什么
- flutter - 参数类型 'void Function()?' 不能分配给参数类型 'void Function(String)?'
- flutter - 如何将我的图像放入容器中?
- wordpress - 如何重写不存在的 url 以显示来自 wordpress 的动态页面的内容
- regex - For 循环和 If 语句未按预期执行
- android - 建议媒体存储和访问共享用户文件
- gdb - 如何解决在 CTF 问题中调用 system(/bin/sh) 后发生的此段错误?
- django - tinymce 和 vuejs 整数化