gpt4 book ai didi

git - Jenkins 多分支管道不修剪从远程删除的分支

转载 作者:太空狗 更新时间:2023-10-29 13:44:53 32 4
gpt4 key购买 nike

我在 Jenkins 中设置了一个多分支管道作业,设置为自动构建打开的分支。但是,当我关闭一个分支并将其从远程删除时,它似乎并没有删除该项目。我检查了丢弃的项目设置以确保它未设置,但似乎 Jenkins 正在拾取分支,即使它已从远程删除。

例如,分支 feature/INT-542-Sample 已从远程删除,但即使在修剪后,它仍被检测为 Jenkins 中的分支。

Started by user Jenkins User
[Wed Jun 07 13:51:52 EDT 2017] Starting branch indexing...
> git rev-parse --is-inside-work-tree # timeout=10
Setting origin to git@bitbucket.org: company-ondemand/project-sync.git
> git config remote.origin.url git@bitbucket.org: company-ondemand/project-sync.git # timeout=10
Fetching origin...
Fetching upstream changes from origin
> git --version # timeout=10
using GIT_SSH to set credentials Master SSH Key for Git Creation
> git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/*
using GIT_SSH to set credentials Master SSH Key for Git Creation
> git ls-remote git@bitbucket.org: company-ondemand/project-sync.git # timeout=10
> git rev-parse --is-inside-work-tree # timeout=10
Setting origin to git@bitbucket.org: company-ondemand/project-sync.git
> git config remote.origin.url git@bitbucket.org:company-ondemand/project-sync.git # timeout=10
Fetching & pruning origin...
Fetching upstream changes from origin
> git --version # timeout=10
using GIT_SSH to set credentials Master SSH Key for Git Creation
> git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/* --prune
Getting remote branches...
Seen branch in repository origin/develop
Seen branch in repository origin/feature/INT-542
Seen branch in repository origin/feature/INT-542-Sample
Seen branch in repository origin/master
Seen 4 remote branches
Checking branch feature/INT-542
‘Jenkinsfile’ found
Met criteria
No changes detected: feature/INT-542 (still at a88426b7ac1dad632b5df7b4e165aafa12bddce7)
Checking branch develop
‘Jenkinsfile’ found
Met criteria
No changes detected: develop (still at ec776ac8e6c639ea2b395f92e8aad572945ae270)
Checking branch master
‘Jenkinsfile’ not found
Does not meet criteria
Checking branch feature/INT-542-Sample
‘Jenkinsfile’ found
Met criteria
No changes detected: feature/INT-542-Sample (still at ec776ac8e6c639ea2b395f92e8aad572945ae270)
Done.
[Wed Jun 07 13:51:54 EDT 2017] Finished branch indexing. Indexing took 2.2 sec
Finished: SUCCESS

最佳答案

您的问题有两种可能的解决方案。

  1. 将 JGit 设置为 Jenkins 上的 Git 可执行文件。参见 this answer
  2. 您使用的 Git 版本太旧。我的系统上有 1.7.something 并且遇到了同样的问题。将 Git 升级到 2.13.1 后,已删除分支的作业已被正确禁用。

亲切的问候,伊夫

关于git - Jenkins 多分支管道不修剪从远程删除的分支,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44419841/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com