I pull the branch with tag in the groovy

2019-06-05 17:20发布

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.

2条回答
▲ chillily
2楼-- · 2019-06-05 18:00

My guess:

sum

needs to be

scm

:)

查看更多
祖国的老花朵
3楼-- · 2019-06-05 18:06

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')
  }
}
查看更多
登录 后发表回答