From what I understand, you want to get a task in which the user selects a branch. Branches should be kept in sync with branches in GitLab.
One way to do this is through the DSL plugin .
- Create a task, possibly called a task creator, that runs every X minutes or runs from GitLab.
- Let job-creater complete the DSL build step.
- DSL may ask GitLab with REST to get branches. Scroll through the branches to create pipelining.
The DSL task will look something like this:
... pipelineJob("the pipeline job") { parameters { def branches = ['[Choose]'] getJson(server+ "/rest/request/to/gitlab...") .values .each { branch -> if (branch.displayId.startsWith('feature')) { branches.push(branch.displayId) } } choiceParam( 'branch', branches, 'Pick a branch.') } ...
source share