为什么jenkins不应该在多次提交的情况下构建呢?

时间:2017-04-14 13:51:10

标签: git jenkins jenkins-plugins git-commit git-checkout

我在詹金斯有一个参数化的工作。它做什么它接收一个git哈希,然后通过提交哈希运行checkout(在branches参数中提交哈希)。问题是当jenkins离线一段时间后,同时新的提交将被推送到回购。当Jenkins再次联机时,会收到一个提交哈希值,并且当它应该构建这个提交时,它会接受所有在此期间构建的提交,尽管只有一个哈希传递给checkout。

为什么会发生这种情况,如何避免这种情况?

编辑:这是工作日志:

[Pipeline] node
Running on master in /var/lib/jenkins/workspace/tester
[Pipeline] {
[Pipeline] stage (CHECKOUT)
Using the ‘stage’ step without a block argument is deprecated
Entering stage CHECKOUT
Proceeding
[Pipeline] checkout
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url http://testrepo.git # timeout=10
Fetching upstream changes from http://testrepo.git
> git --version # timeout=10
> git fetch --tags --progress http://testrepo.git +refs/heads/*:refs/remotes/origin/*
> git rev-parse <mycommithash>^{commit} # timeout=10
Checking out Revision <mycommithash> (detached)
> git config core.sparsecheckout # timeout=10
> git checkout -f <mycommithash>
> git rev-list <someotherhash> # timeout=10
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
Finished: SUCCESS

0 个答案:

没有答案
相关问题