Gerrit Trigger does not work on several JM's SCMs

I am trying to configure Jenkins for a project. I use git as SCM and gerrit as a code checker. My project consists of many repositories, so I use the MultipleSCM plugin in Jenkins to register various repositories. I configured Gerrit Trigger to run the build when code validation occurs. The problem is that when a user makes changes to any repo all, all other repositories get the same CHANGE data that is not valid in any other repo.

> git rev-parse 873a6b7209411fa825f35da1c6fbc7f280cff06b^{commit} # timeout=10 ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job. Finished: FAILURE 

How to solve a problem? Please help. Is there any work. Thanks in advance.


Jenkins Version: 1.588 Plugins Used: git, gerrit-trigger, multiple-scm. I have two gerrit projects (gerrit1 and gerrit2). I use the gerrit project in the same jenkins work (because they depend). If one developer makes changes to gerrit1 and clicks on gerrit, Jenkins gets a trigger and starts building. This work is perfect when there is one gerrit project. But in my case, if there are changes in gerrit1, gerrit2 will have the same changes in jenkins. Therefore, the check is not performed for gerrit2, as the branches may be different.

+5
source share
3 answers

They do not support each other. You will want to create a separate task and trigger for each repository.

0
source

I ran into the same problem and was able to configure a Gerrit trigger with the Multiple SCMs . Here is my solution (actually it was one of the recommendations on the Gerrit plugin page):

  • For the git repository that you want to configure, click the Advanced button and put Refspec : refs / changes / *: refs / changes / * in the field
  • Also for the same repository, configure the Branch Specifier as follows: $ GERRIT_REFSPEC

After that, the trigger assemblies in Jenkins have been updated to fix the / ref branch.

0
source

Perhaps a good solution would be to create git submodules. Parent will contain all actual repositories

0
source

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


All Articles