我已经使用 MultiBranch 管道与 Jenkins 建立了一份工作。Github 是 SCM 并已配置,带有一个 webhook 以在 PR 提交上触发构建。(现有的或新的 PR)。
构建被触发,一切正常1,但是 CHANGE_ID 未设置(null)。我们需要将 CHANGE_ID 传递给 Sonar。
我很难理解,在哪些情况下会设置此参数,以及为什么在我们的情况下它为空。
请从 Jenkins Multibranch 的角度考虑这个问题。我们的(与 git 相关的)插件安装在这里 [2] 。
1来自 Jenkins 的日志记录。
[Mon Jun 26 11:32:48 CEST 2017] Received Push event to branch BE-7394 in repository ServiceHouse/api UPDATED event from 172.18.0.1 ⇒ http://jenkins2.servicehouse.nl:8080/github-webhook/ with timestamp Mon Jun 26 11:32:43 CEST 2017
11:32:50 Connecting to https://api.github.com using shojenkinsuser/******
Looking up ServiceHouse/api
11:32:50 Connecting to https://api.github.com using shojenkinsuser/******
Looking up ServiceHouse/api
Getting remote branches...
Checking branch BE-7394
Getting remote branches...
Checking branch BE-7394
‘Jenkinsfile’ found
Met criteria
Changes detected: BE-7394 (01293286b6ee34056d8c92e21a6d39d18e537a81 → 35c16ef01bba5d27dd040a881cd3734fef271fd7)
Scheduled build for branch: BE-7394
0 branches were processed (query completed)
Done examining ServiceHouse/api