Jenkins multi-drop pipe does not tag

I am trying to get the Jenkins multi-channel pipeline working to create tags in the same way as branches. In Jenkins 2.73 (not sure when the functionality was added), Multibranch projects can be configured to extract both branches and tags from the source repository. Initially, I thought it would be ideal for my needs (my Jenkinsfile can now build development or create assemblies from the same place in Jenkins). Tagged job with tag detection installed

I have the build process itself and works quite successfully with the script, but my problem is that while the branch tasks fire my triggers fine (Cron weekly) and therefore run using the Git plugin function notifyOnCommit (allows me to clean the assembly weekly , but build on commit on the repo, and also through the webhook to check the repo), tag assemblies do not work.

Has anyone else come across this? If so, have you found a reasonable way to solve it?

The corresponding fragment from my script (I tried with setting overrideIndexTriggers and without it): properties( [ pipelineTriggers( triggers: [ cron('H 02 * * 7') ] ), overrideIndexTriggers(true) ] )

Configuring polling from a branch job generated by a multi-channel pipeline seems fine Jobs created from tags on a multi-channel pipeline do not get the same configuration, strange ...

There is a note in the multi-block protocol scan log that states that tags will never be automatically assigned: Processed 8 branches Checking tags... Checking tag testing 'Jenkinsfile' found Met criteria No automatic builds for testing Processed 1 tags [Mon Oct 23 09:55:00 UTC 2017] Finished branch indexing. Indexing took 8.1 sec Finished: SUCCESS Processed 8 branches Checking tags... Checking tag testing 'Jenkinsfile' found Met criteria No automatic builds for testing Processed 1 tags [Mon Oct 23 09:55:00 UTC 2017] Finished branch indexing. Indexing took 8.1 sec Finished: SUCCESS

My project is docker based, and I would like to run the final build weekly to pull out any changes to the base image, etc.

Does anyone have any ideas on what I can do to get projects with multiple branches for planning tag creation?

+1
source share
1 answer

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 might have a storm when checking the repository), and even worse, order tags will be built into the unpredictable ... and you may have a Jenkins file that is deployed during production when tag is created.

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

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

0
source

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


All Articles