在Jenkins管道中签出标签 [英] Checkout a tag in Jenkins pipeline

查看:317
本文介绍了在Jenkins管道中签出标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试使用

checkout scm: [$class: 'GitSCM', 
  userRemoteConfigs: [[url: '${repoURL}']], 
  branches: [[name: 'refs/tags/${tag-version}']]],poll: false

此操作失败,并显示身份验证错误.除了使用

This fails with an Authentication error. Is there any way other than using

withCredentials

withCredentials

在Jenkinsfile中签出标签

to checkout tag in a Jenkinsfile

推荐答案

花费后,几个小时就到了

After spending, hours got here

在声明式管道中使用GitSCM的正确方法是

Correct way to use GitSCM in declarative pipeline is

checkout scm: [$class: 'GitSCM', userRemoteConfigs: [[url: repoURL, credentialsId: credential]], branches: [[name: tag-version]]],poll: false

不像我在网络上的大多数地方都找到的

Not like I found in most places in web

checkout scm: [$class: 'GitSCM', userRemoteConfigs: [[url: repoURL], [credentialsId: credential]], branches: [[name: tag-version]]],poll: false

这篇关于在Jenkins管道中签出标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆