【发布时间】:2020-01-09 10:11:57
【问题描述】:
所以我目前正在尝试构建一个 Jenkins 管道,该管道由通过 bitbucket webhooks 提交到两个分支之一自动触发。
为了让作业开始工作,我必须手动触发为两个分支之一启动构建的作业。从这里我可以提交并推送到该分支并看到 Jenkins 作业自动被触发。
我遇到的问题是,即使在提交/推送更改时,它也永远不会构建另一个分支。
谁能帮我找出为什么只建一个分支而不建另一个? (触发的是开发分支)
String folderPath = 'folder/path'
folder("$folderPath")
pipelineJob("$folderPath/the-pipeline") {
description 'WARNING: This pipeline is generated automatically any manual changes may be overwritten.'
triggers {
bitbucketPush()
}
definition {
cpsScm {
scm {
git {
remote {
url 'git@bitbucket.company/project.git'
credentials 'bitbucket-credentials'
}
branches('develop', 'master')
}
}
scriptPath("Jenkinsfile")
}
concurrentBuild(false)
}
logRotator {
daysToKeep(-1)
numToKeep(15)
artifactDaysToKeep(-1)
artifactNumToKeep(15)
}
【问题讨论】:
-
可能是其他分支可能没有jenkinsfile,导致问题