0

I've got to connect Jenkins with an Azure Devops repository. Unfortunately, the Jenkins is behind corporate bars and can't be webhooked from the repository upon a change.

So, I ended up with the good ol' polling in my pipeline job. Since the project uses a gradle scm workflow plugin that calculates the version number and the creation of a release from the git structure, I need to have the jenkins polling react to a tag push.

So, is it anyhow possible to make the jenkins polling be aware of tag pushes at a remote, which means, no additional commit has been done?

ferdy
  • 7,366
  • 3
  • 35
  • 46

1 Answers1

1

It is possible to make jenkins polling be aware of tags by setting refspec and branch specifier as below. But it is not working if no changes is committed in the source. See this open issue.

refspec: +refs/tags/*:refs/remotes/origin/tags/*

branch specifier: **

You might need to create two jenkins pipelines, first pipeline will run every N minutes to execute git tag as a shell command and get the all tags from git, And writing the tag in the some property file, And then compare with tags from the last time. If there is a new tag, then trigger the second the pipeline. See the comment to this answer

Levi Lu-MSFT
  • 27,483
  • 2
  • 31
  • 43
  • Thanks for clarifying again, that it is not possible to make jenkins git polling tag aware the easy way. I've actually tried to use azure devops api to poll for tag changes but found it to complex in terms of authentication and so on. We finally ended up by having a jenkins job mirroring the azure devops repository into our internal gitlab once per minute. This enables us to just use the gitlab plugin. The effort to mirror a repo also in terms of traffic is less than the API variant. – ferdy Sep 24 '20 at 05:06