Jenkins Bitbucket 团队/项目工作不再获取标签

标签 jenkins

我有一个 Jenkins Bitbucket 团队/项目工作。
在我的存储库中的 Jenkinsfile 中,我使用“git describe”来获取当前标签。
在我更新到最新的 Jenkins 版本 (2.60.3) 并更新了大多数插件后,这失败了,因为 Jenkins 不再获取标签。

这是我更新前的样子:

Branch event
Checking out git https://bitbucket.org/xxxxxxx to read Jenkinsfile
 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url https://bitbucket.org/xxxxx.git # timeout=10
Fetching upstream changes from https://bitbucket.org/xxxx.git
 > git --version # timeout=10
using GIT_ASKPASS to set credentials Admin user to clone bitbucket repositories
 > git fetch --tags --progress https://bitbucket.org/xxxxx.git +refs/heads/master

这就是我现在所拥有的:
Branch event
Checking out git https://bitbucket.org/xxxx.git into /var/lib/jenkins/jobs/xxxx/jobs/xxx/branches/master/workspace@script to read Jenkinsfile
Cloning the remote Git repository
Cloning with configured refspecs honoured and without tags
Cloning repository https://bitbucket.org/xxxxx.git
 > git init /var/lib/jenkins/jobs/xxx/jobs/xxxx/branches/master/workspace@script # timeout=10
Fetching upstream changes from https://bitbucket.org/xxx.git
 > git --version # timeout=10
using GIT_ASKPASS to set credentials Admin user to clone bitbucket repositories
 > git fetch --no-tags --progress https://bitbucket.org/xxxx.git +refs/heads/master:refs/remotes/origin/master

这是我安装的插件:
  • Bitbucket 分支源插件 2.2.3
  • Bitbucket 插件 1.1.5
  • Git 客户端插件 2.5.0
  • Git 插件 3.5.1

  • 默认行为已更改。它不再获取标签(使用 --no-tags)。
    我找不到任何设置来强制 jenkins 获取标签。
    在 Bitbucket 团队/项目设置中,您可以设置“高级克隆行为”:
  • 浅克隆
  • ...
  • 不获取标签

  • 未选择“不提取标签”。所以我认为它应该默认获取标签......

    有人有类似的问题吗?
    如何强制 Jenkins 在 Bitbucket 团队/项目作业中获取标签?

    最佳答案

    我创建了一个 Jenkins 问题并得到了一些解释(感谢 Stephen Connolly):https://issues.jenkins-ci.org/browse/JENKINS-46736

    解决方案只是添加“高级克隆行为”并取消选中“不获取标签”。

    关于Jenkins Bitbucket 团队/项目工作不再获取标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45996719/

    相关文章:

    python - 如何在 Jenkins 作业中启动 Window exe 文件

    python - 如何使用 Python 包 JenkinsAPI 触发 Jenkins 构建?

    ssl - Archiva Jenkins 通过 https 通讯

    tomcat - Jenkins 将 war 文件部署到 Tomcat 8 - 网页显示错误

    jenkins - 使用 Groovy 配置 Jenkins EC2-Plugin

    jenkins - Jenkins声明式管道Docker注册中心

    ssh - Jenkins 通过 SSH 奇怪重新启动 Slave Agent

    windows - 如何在 Jenkins 构建期间在批处理命令中传递特定参数

    jenkins - 捕获 Jenkins 输入步骤的结果

    ios - pod install 在 Jenkins 上给出错误