簡體   English   中英

Jenkins 管道從 windows jenkins 服務器推送 git 標簽

[英]Jenkins pipeline push git tags from windows jenkins server

在我的 jenkins 管道中,我需要標記特定的提交並推送它們。 標記到特定提交已完成,因為它標記在本地存儲庫上。 但是當我嘗試推送到遠程時,它卡住了。

經過研究,我發現它需要從我的服務器進行身份驗證才能將 --tags 推送到遠程。

withCredentials([usernamePassword(credentialsId: 'd3e19626-62d7-4acc-8090-1b0f39fdfc47', passwordVariable: 'GIT_PASSWORD', usernameVariable: 'GIT_USERNAME')]) {
    bat "git tag Jenkins_build_${env.BUILD_NUMBER} ${env.GIT_COMMIT}"
    bat "git push https://${GIT_USERNAME}:${GIT_PASSWORD}@git.ABC.com:8443/ABC/ABC-dev.git --tags"
}

所以最后我在我的管道中像這樣管理我的代碼。

但是現在它給我帶來了錯誤的 url 錯誤Bad URL screenshot ,我在命令提示符下嘗試了相同的 url 並且它工作正常。

應要求回答我所面臨的情況。

請找到截圖,它可以幫助使用Git Publisher推送標簽。 這里SERVICE_NAME 和 DEPLOY_FOR只是預定義的屬性。 Git 發布者

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM