Pull changes when a tag is created

65 views
Skip to first unread message

jayarama...@gmail.com

unread,
Sep 22, 2021, 3:50:30 PM9/22/21
to Jenkins Users
Hello,

I wanted to trigger a Jenkins build when a new tag is created but I'm not having any luck with it. 

Just to be sure I mentioned it, I don't have access to modify the repo since it's a public repo.

The following configuration is what I used in the "Git" Source Code Management
Repo URL: https://github.com/apache/tomcat.git
Refspec: +refs/tags/8.5.*:refs/remotes/origin/tags/8.5.*
Branch Specifier: **/tags/**
Build Trigger: Poll SCM (with no schedule)

Is there something I'm doing wrong?

I can't do WebHooks which is unfortunate I think

Any insights would be appreciated. 

SCM.jpg

Triggers.jpg

Thanks

Mark Waite

unread,
Sep 22, 2021, 4:14:13 PM9/22/21
to Jenkins Users
If you're running the default command line git version on CentOS 7, it does not accept partial globs in the refspec.  The command line git documentation for refspec says:

Since Git 2.6.0 you can use partial globs in the pattern to match multiple branches, so this works:

fetch = +refs/heads/qa*:refs/remotes/origin/qa*

If you're running a command line git version before 2.6.0, your partial glob won't work.

jayarama...@gmail.com

unread,
Sep 23, 2021, 11:05:42 AM9/23/21
to Jenkins Users
Thanks Mark, we have compiled 2.33.0 from source so partial should work but Jenkins doesn't pull repo when there's a tag created. 

Björn Pedersen

unread,
Sep 27, 2021, 3:03:41 AM9/27/21
to Jenkins Users

On Wednesday, September 22, 2021 at 11:50:30 AM UTC-8 jayarama...@gmail.com wrote:
Hello,

I wanted to trigger a Jenkins build when a new tag is created but I'm not having any luck with it. 

Just to be sure I mentioned it, I don't have access to modify the repo since it's a public repo.

The following configuration is what I used in the "Git" Source Code Management
Repo URL: https://github.com/apache/tomcat.git
Refspec: +refs/tags/8.5.*:refs/remotes/origin/tags/8.5.*
Branch Specifier: **/tags/**
Build Trigger: Poll SCM (with no schedule)

Is there something I'm doing wrong?

I can't do WebHooks which is unfortunate I thin


If you can't use webhooks than you need a schedule ( otherwise the polling will never run).

Björn 
Reply all
Reply to author
Forward
0 new messages