Using a different jenkinsfile path with Blue Ocean
Asked Answered
V

1

9

Summary

The Blue Ocean editor ignores the Script Path setting for the multibranch pipeline plugin and instead saves the Jenkinsfile in the repository root. Is this a bug?

Background

We have a single repository with several projects in it, so we're trying to setup many multibranch pipeline jobs, with each of them pointing to the same repository.

The first problem we encountered was that the Jenkinsfile which stores the pipeline code was stored in the root of the repository, the problem being that this was the same location for each Job. We subsequently discovered that as of June 2017 you can now specify a Jenkinsfile location per job in the multibranch pipeline plugin. Great.

Adding Blue Ocean into the mix: when editing the pipeline in the Blue Ocean editor it seems to be disregarding the Script Path setting, and instead saving the resulting pipeline code in a fixed location (the root of the repository). When the job runs however, it picks up the correct location, so it seems to be a bug with the editor.

We've searched the Blue Ocean backlog but can't find an existing issue, could we have discovered a new bug? We're very new to Jenkins, so I'm not sure if a) we're not setting this up correctly or b) Blue Ocean isn't expected to work this way.

Configuration

Multibranch Pipeline Job 1
Name: Foo
Repository Name: test
Build Configuration -> Script path: Build/Jenkins/Foo/jenkinsfile

Multibranch Pipeline Job 2
Name: Bar
Repository Name: test
Build Configuration -> Script path: Build/Jenkins/Bar/jenkinsfile

The sample repository has 2 branches, master and dev.

Vitrain answered 15/11, 2017 at 14:16 Comment(3)
I can confirm this issue. It seems to be a bug in the editor to me. Best way would be to create a bug report.Fashoda
Has anyone opened a bug?Cousingerman
issues.jenkins-ci.org/browse/JENKINS-50328Efferent
S
1

This bug is fixed in BlueOcean 1.22.0

Saffron answered 17/5, 2020 at 0:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.