-
New Feature
-
Resolution: Fixed
-
Critical
-
None
Currently gitlab-hook-plugin searches all the jobs that match given repository url.
In fact, I use multijob configuration like the following:
MainJob <-- uses git configuration so gitlab-hook-plugin can find & clone & start it * Phase 1: compile job <-- uses git to fetch project sources * Phase 2: deploy * Phase 3: fast tests <-- uses git to fetch tests ...
Current gitlab-hook-plugin triggers all the jobs, not just the main one.
In my installation I've modified plugins\gitlab-hook\WEB-INF\classes\models\use_cases\process_commit.rb }} as follows (added {{ && (project.description.match /#{settings.description}/)) so it triggers only jobs with autogenerated description:
def get_projects_to_process(details) projects = @get_jenkins_projects.matching_uri(details) if projects.any? if settings.automatic_project_creation? projects.select! do |project| project.matches?(details, details.branch, true) && (project.description.match /#{settings.description}/) end projects << @create_project_for_branch.with(details) if projects.empty?
However, it could make sense to use another approach: get the job by name (hook knows naming convention, so it can get the job) check if that matches. In case the job does not match fallback to the current implementation.
- is related to
-
JENKINS-29283 Allow cloning job trees when creating job via gitlab web hook
- Closed
-
JENKINS-29318 Support deleting multiple jobs on branch delete
- Resolved