简体   繁体   English

在 Jenkins 多分支管道上扫描存储库后未触发作业构建(检测到更改)

[英]Job build not triggered after repository scan on Jenkins Multibranch Pipeline (changes detected)

I have set git post-commit hook which triggers scan on my Multibranch Pipeline.我已经设置了 git post-commit 钩子,它会在我的多分支管道上触发扫描。 This scan detects changes (new commit) but do not triggers building job for changed branch.此扫描检测更改(新提交),但不会触发更改分支的构建作业。

Scan Multibranch Pipeline Log

Branch indexing

... git messages ...

Checking branches...
  Checking branch develop
      ‘Jenkinsfile’ found
    Met criteria
No changes detected: develop (still at 5ed9c9a76ef81bf023c1ea89c7515458e8ac548d)
  Checking branch master
      ‘Jenkinsfile’ found
    Met criteria
No changes detected: master (still at c9ac551806eb5a90dccf093e58c907f330407b9b)
  Checking branch feature/Model
      ‘Jenkinsfile’ found
    Met criteria
Changes detected: feature/Model (2e5a898498e138737941a907969eb80ee533a900 → b931de01b1f8dd51a2646f109b185592ea941f7f)
Did not schedule build for branch: feature/Model
Processed 3 branches
...
Finished: SUCCESS

And as a result now I have to start all jobs manually.因此,现在我必须手动启动所有作业。

I've found similar issue: Did not schedule build for branch but there is no answer how to fix this issue.我发现了类似的问题: 没有为分支安排构建,但没有解决如何解决此问题的答案。

Can you help?你能帮我吗?

For others who will face similar problem:对于将面临类似问题的其他人:

Be sure to don't have set property:确保没有设置属性:

(Deprecated )Suppress automatic SCM triggering (已弃用)禁止自动 SCM 触发

in "Branch sources" section of Multibranch Pipeline configuration.在多分支管道配置的“分支源”部分。 this kills received trigger and build is not started.这会杀死收到的触发器并且未开始构建。 After removing this property builds are done just after you commit them.删除此属性后,将在您提交后立即完成构建。

My problem was that in Build Strategies, I specified specific branches I wanted to run.我的问题是在 Build Strategies 中,我指定了我想要运行的特定分支。 By removing the named branches, the builds started to automatically build.通过删除命名分支,构建开始自动构建。

Even when using the wildcard for all branches, it would not build.即使对所有分支使用通配符,它​​也不会构建。 I had to remove named branches altogether.我不得不完全删除命名分支。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM