Reputation: 316
So I need to make a validation in some files names during merge from any branch to develop branch in my repository. I searched a lot but only examples I found is to integrate Jenkins and GitLab to build project in each commit/push, etc.
But is it possible to configure somehow a pre-push script to be executed (maybe by Jenkins) in server-side so each time a push is received to merge something to this develop branch I execute my custom script? I don't want to build it, only make this validation of files to be able to stop or not the push request.
Upvotes: 4
Views: 2069
Reputation: 1327784
The Jenkins GitLab hook plugin is there to listen and receive each push events sent to GitLab (for a given repository).
From there you can trigger any Jenkins job you want (not necessarily a build job) with the script you want to execute.
If you want to execute said script before merging to the develop branch, you need to make the webhook monitor push events done on a dedicated branch (that would trigger the script which would then merge to dev and push)
If your GitLab instance is on-premise, then you can consider setting up a "Custom server-side Git hooks", like:
Upvotes: 2