2017-09-01 46 views
1

我有Jenkins Bitbucket團隊/項目工作。 在我的倉庫中的Jenkinsfile裏面我使用「git describe」來獲取當前標籤。 當我更新到最新的Jenkins版本(2.60.3)並更新了大多數插件後,失敗了,因爲Jenkins不再獲取標籤。Jenkins Bitbucket團隊/項目工作無法取得標籤

這是我更新之前曾:

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/[email protected] 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/[email protected] # 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 

這是我所安裝的插件:

  • 到位桶分公司源插件2.2.3
  • Bitbucket插件1.1.5
  • Git的客戶端插件2.5.0
  • Git的插件3.5.1

的默認行爲改變。它不再提取標籤(使用--no-tags)。 我找不到任何設置來強制jenkins獲取標籤。 在到位桶團隊/項目設置,可以設置 「高級克隆行爲」:

  • 淺克隆
  • ...
  • 不要抓取代碼

「不要抓取代碼」未選中。所以我認爲它應該默認取標籤...

任何人都有類似的問題? 如何強制Jenkins在Bitbucket Team/Project作業中獲取標籤?

+0

對我來說同樣的問題! – AnthoniS

+0

我見過你在Bitbucket插件中報告了一個bug:https://issues.jenkins-ci.org/browse/JENKINS-46736?jql=project%20%3D%20JENKINS%20AND%20status%20in%20(Open %2C%20%22英寸%20Progress%22%2C%20Reopened)%20於是%20component%20%3D%20bitbucket分支 - 源插件%20於是%20text%20〜%20%22tags%22。你有解決方法嗎?因爲我們使用的是jgitver插件,所以我的項目中必須使用獲取標籤。我不得不回滾到以前版本的插件。 – AnthoniS

+0

我現在使用的解決方法是在我的工作中手動提取標記...我在我的Jenkinsfile的第一步中運行'sh'git fetch --tags''。但是這有點醜,我不能初始化依賴於環境部分中的標籤的變量(在聲明模式下)... –

回答