job-dsl-plugin icon indicating copy to clipboard operation
job-dsl-plugin copied to clipboard

Add support for GitLab Branch Source plugin

Open ljackiewicz opened this issue 1 year ago • 1 comments

These changes add support for GitLab Branch Source plugin. These were based on components that add support for similar plugin - GitHub Branch Source.

The solution was manually tested on own Jenkins instance.

Example of JobDSL script (for creating Multibranch Pipeline with "GitLab project" as source):

multibranchPipelineJob('example') {
  branchSources {
    branchSource {
      source {
        gitlab {
          id('example-id')
          credentialsId('gitlab-ci')
          projectOwner('ownerName')
          projectPath('ownerName/projectName')
        }
      }
    }
  }
}

Submitter checklist

  • [x] Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • [x] Ensure that the pull request title represents the desired changelog entry
  • [x] Please describe what you did
  • [ ] Link to relevant issues in GitHub or Jira
  • [ ] Link to relevant pull requests, esp. upstream and downstream changes
  • [x] Ensure you have provided tests - that demonstrates feature works or fixes the issue

ljackiewicz avatar Nov 23 '23 19:11 ljackiewicz