Answer the question
In order to leave comments, you need to log in
Jenkins: how to run build only when there is a new tag in git?
Hello everyone,
I ran into a seemingly trivial task in Jenkins - you need to run build when a new tag with a specific name hits, for example build_[0-9]{6,10} . The code itself is stored on github, since the rights are limited, I use SCP Polling to poll for changes.
It would seem that everything should be very simple, but in reality it turned out that it was not. I use the following options
Name: origin
Refspec: +refs/tags/*:refs/remotes/origin/tags/*
Branch Specifier: :.*/tags/build_[0-9]{6,10}$
550313e -> 22ce31f -> e31e663 -> e4c4bf6 (head)
tag1 tag2 tag3 tag4
$ git tag build_000002 550313e && git push --tags -u origin
$ git tag build_000003 22ce31f && git push --tags -u origin
$ git tag build_000004 e31e663 && git push --tags -u origin
$ git tag build_000001 e4c4bf6 && git push --tags -u origin
550313e -> 22ce31f -> e31e663 -> e4c4bf6 (head)
tag2 tag3 tag4 tag1
$ git tag build_000001 e4c4bf6 && git push --tags -u origin
$ git tag build_000002 550313e && git push --tags -u origin
$ git tag build_000003 22ce31f && git push --tags -u origin
$ git tag build_000004 e31e663 && git push --tags -u origin
Answer the question
In order to leave comments, you need to log in
wait wait? why does your build pass only in releases? ))
Do you have CI?
CI is a build for each repository change
ZY I use another CI server (QuickBuild), I have the following scheme:
for each commit - assembly (compilation, tests)
and when we make a release, then it is the commit that successfully completed the assembly
and the SERVER ITSELF already re-builds with the keys , like, "This is Release", the tests no longer run, tk. this commit puts a tag on this commit, and pushes the tag to the "central" repository
, as for me, this is a more correct scheme
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question