Page MenuHomeDevCentral

Add support for Jenkins 2.0 multi-branch pipelines
Closed, ResolvedPublic

Description

If the class of a job is org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject, there is a need to parse one job per branch.

To do so, iterate the jobs key, appending the branch to the name, and then we can parse it like a regular job with self.parse_project.

Perhaps also if there is only one job, we can omit the branch suffix.

For example, the two syntax are equivalent:

$ curl https://cd.nasqueron.org/api/json?depth=1 | jq .jobs[0].name  
limiting-factor-doc
$ curl https://cd.nasqueron.org/api/json?depth=1 | jq .jobs[1].name  
tests-prod-environment-behaves-correctly
$ curl https://cd.nasqueron.org/api/json?depth=1 | jq .jobs[1].jobs[0].name
master
$ curl https://cd.nasqueron.org/api/json?depth=1 | jq .jobs[1].jobs[0].color
red

Event Timeline

dereckson triaged this task as Wishlist priority.Sep 20 2018, 21:21
dereckson created this task.
dereckson updated the task description. (Show Details)
dereckson updated the task description. (Show Details)

Small fix, as cd.nasqueron.org depth=2 can't work, we'll put this feature behind an environment variable guard.