I pull the branch with tag in the groovy

我的梦境 提交于 2019-12-12 10:17:19

问题


I want to pull specified branch with tag.

So i write job as following

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

But it does not work.

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

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.


回答1:


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')
  }
}



回答2:


My guess:

sum

needs to be

scm

:)



来源:https://stackoverflow.com/questions/40651385/i-pull-the-branch-with-tag-in-the-groovy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!