我在groovy中拉带有标签的分支 [英] I pull the branch with tag in the groovy

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

问题描述

我要拉带有标签的指定分支.

I want to pull specified branch with tag.

所以我写如下工作

job('abc'){
    scm{
        git('ssh://git@abc.git', 'refs/tags/test-tag1')
    }
}

但是它不起作用.

我输入了分支名称或提交到第二个参数,它将拉出指定的分支.

I inputted branch Name or commit into 2nd param, it will pull the specified branch.

它可以与[Jenkins Job DSL插件]文档中的标签一起使用.

It can work with tag from the document of [Jenkins Job DSL Plugin].

我想知道为什么它不起作用,否则我的工作是错误的.

I want to know why it doesn't work, Or my job is wrong.

推荐答案

您只需要指定标签名称即可.这对我有用:

You just need to specify the tag name. This works for me:

job('example'){
  scm {
    git('https://github.com/jenkinsci/job-dsl-plugin.git', 'job-dsl-1.53')
  }
}

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

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