Is there a way to automatically create tags using the Multibranch Pipeline Jenkins plugin?

After creating the Multibranch Pipeline in Jenkins, I can easily talk about it to poll changes or additions to any branches, and it will automatically create jobs for these branches and build them. I said that the Multibranch task also detects tags, so it automatically creates tasks for each tag, which is great.

Is there a clean way for Jenkins to automatically create these tags, instead of having to run them manually? As you can see below, there is a tag job, but I need to manually create it.

enter image description here

+5
source share
2 answers

I would comment on this, but I do not have enough reputation. I believe this is a duplicate. Jenkins multi-segment pipeline does not plan a tag schedule . See My answer there, copied below.

In short, if you create and install the Jenkins plugin, available at https://github.com/AngryBytes/jenkins-build-everything-strategy-plugin , then you can add the Build Everything strategy, which will automatically create tags.


It is not possible to automatically create an assembly for detected tags, apparently by design in accordance with JENKINS-47496 . Stephen Connolly offers an explanation and suggestion on what you can do:

Stephen Connolly added a comment - 6 days ago

Tags are not built by default (because otherwise you could build a storm when checking the repository), and, even worse, order tags will be built unpredictably ... and you may have a Jenkinsfile that is deployed to produce when the tag is created.

There is an extension point in the api branch called BranchBuildStrategy which, if implemented, will decide whether to create tags.

See https://github.com/jenkinsci/github-branch-source-plugin/pull/158#issuecomment-332773194 for a start, how to create such an extension plugin ... I believe there is some work on https: // github .com / AngryBytes / jenkins-build-everything-strategy-plugin

+2
source

As @ tommy-ludwig says, you need an additional plugin that provides a build strategy; Beginning in his original post, Stephen Connolly has published The Basic Branch Building Strategies Plugin , which, among other things, provides a tagging strategy .

+1
source

Source: https://habr.com/ru/post/1273153/


All Articles