我们有 10-15 个 git 分支,但我们只想在其中 2 个(“master”和“beta1”)上触发 Jenkins 作业。我正在使用 Jenkins 的Git 插件,并在“要构建的分支”部分中指定“master”和“beta1”。我还在“repo 的本地子目录(可选)”字段中指定了 ${GIT_BRANCH}。
我只想在主分支上出现签入时才在主分支上触发 Jenkins 作业。
我只想在 beta1 分支上出现签入时才在 beta1 分支上触发 Jenkins 作业。
我希望这两个分支都由同一个 Jenkins 作业控制,以便内部版本号在两个分支之间是唯一的(如果它们在两个不同的作业中,内部版本号可能是相同的)。
目前,它似乎正在触发 beta1 分支上的工作,以便从 master 分支签入。从日志中(注意:下面日志第一行中报告的更改来自主分支):
Started by remote host (IP) with note: Triggered by push of revision e4391d0049ff: "blah" to (URL) by (USER)
Building in workspace /var/lib/jenkins/jobs/Orca/workspace
Checkout:workspace / /var/lib/jenkins/jobs/Orca/workspace - hudson.remoting.LocalChannel@3ae1a582
Using strategy: Default
Last Built Revision: Revision 7e2aae6c752a16516d9f6ac48944492a4e3596d4 (origin/master)
Wiping out workspace first.
Cloning the remote Git repository
Cloning repository (SSH)
git --version
git version 1.7.4.1
Fetching upstream changes from origin
Cleaning workspace
Resetting working tree
Seen branch in repository origin/(BLAH)
Seen branch in repository origin/(BLAH)
Seen branch in repository origin/(BLAH)
Seen branch in repository origin/(BLAH)
Seen branch in repository origin/(BLAH)
Seen branch in repository origin/(BLAH)
Seen branch in repository origin/beta1
Seen branch in repository origin/(BLAH)
Seen branch in repository origin/(BLAH)
Seen branch in repository origin/(BLAH)
Seen branch in repository origin/(BLAH)
Seen branch in repository origin/(BLAH)
Seen branch in repository origin/(BLAH)
Seen branch in repository origin/(BLAH)
Seen branch in repository origin/(BLAH)
Seen branch in repository origin/(BLAH)
Seen branch in repository origin/(BLAH)
Seen branch in repository origin/(BLAH)
Seen branch in repository origin/(BLAH)
Seen branch in repository origin/(BLAH)
Seen branch in repository origin/master
Seen branch in repository origin/(BLAH)
Seen 22 remote branches
Multiple candidate revisions
Scheduling another build to catch up with Orca
Commencing build of Revision eaad42c836a87672c546d61f310cc31bf03ecb97 (origin/beta1)
Checking out Revision eaad42c836a87672c546d61f310cc31bf03ecb97 (origin/beta1)