-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[JENKINS-34561] Support for configuring the Jenkinsfile location/name #44
Conversation
bring up to date
IIRC there is already a plugin that does something much like this; would prefer to keep this plugin simple and add extended behaviors there. |
I basically have a similar patch in use currently, if there is another plugin that can intgerate here I have not found it. Would be nice though. |
What's the expectation of getting this pull request merged in? The other plug-in (with defaults) doesn't really perform the same behaviour, it simply allows you to specify another (and only one other) file which could be used. It doesn't allow us to define different names and paths for the Jenkinsfile in branch builds. Adds a significant and powerful element to this plug-in. |
…ugin # Conflicts: # src/main/java/org/jenkinsci/plugins/workflow/multibranch/WorkflowBranchProjectFactory.java Conflict fixed into refactor
Lee's mirrored my thoughts too. I'm not seeing how this PR slots in with the functionality of multibranch-defaults. |
I have to agree, the multibranch-defaults-plugin doesn't solve my problems. |
So is there anything that prevents merging this PR? |
For those needing this, I built @dbut023's repo so I could use the config option. Just download and unzip the above hpi file, and upload it to Jenkins manually. Make sure you've installed the official version first as manually uploading it won't sort out the dependancies. I added a stupid verison number (100.0.0) so updates to the official release won't override it, but obviously there's no fixes going into that if new official release are done without this pull request being merged in... |
Other arguments for merge this patch:
|
This is a very useful feature for monorepos. Hoping to see it merged. |
Is there any reason for this to not be merged? |
I will add my vote as well to have this merged. Would like to have this on the open source. |
Voted for this pull request as I am feeling quite limited in multibranch pipeline usage. Currently I'm using a workaround as mentioned in the manual loading documentation but with the pipeline model definition coming up this workaround does no longer work. One cannot use the groovy dsl to load another Jenkinsfile and use the model definition dsl there. |
I can describe an other use-case: I'd like to keep my project root simple and clean, all dirty ops-related stuff goes into |
Any chance this pull request is going to be merged? There have been a few use cases already outlined in the comments. |
Is there anyway with this add on to have jenkins create multiple jobs based off a directory structure like below
Where each dir would have its own Jenkinsfile but the branch would still be just master? If not does someone know a better way of doing that? |
@konetzed that would be awesome, this is one of the larger issues I have with using jenkinsfiles. A single repo needing multiple jobs. I think you can generate new jobs from a jenkinsfile. |
This is very important and useful feature for many people. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concept is fine but the implementation is all wrong, I am afraid. I would need to rewrite from scratch.
} | ||
}; | ||
@DataBoundConstructor public WorkflowBranchProjectFactory() { | ||
super(SCRIPT); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does not make any sense to have two implementation classes.
} | ||
|
||
@Extension public static class DescriptorImpl extends MultiBranchProjectDescriptor implements IconSpec { | ||
|
||
@DataBoundConstructor public DescriptorImpl(){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does not make any sense.
|
||
public DescriptorImpl(){} | ||
|
||
@DataBoundConstructor public DescriptorImpl(AbstractWorkflowBranchProjectFactory factory){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
@@ -56,20 +57,27 @@ | |||
|
|||
private static final Logger LOGGER = Logger.getLogger(WorkflowMultiBranchProject.class.getName()); | |||
|
|||
public WorkflowMultiBranchProject(ItemGroup parent, String name) { | |||
@DataBoundConstructor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @jglick: would it be possible to elaborate on how it should be handled instead?
…ugin # Conflicts: # src/main/java/org/jenkinsci/plugins/workflow/multibranch/AbstractWorkflowMultiBranchProjectFactory.java # src/main/java/org/jenkinsci/plugins/workflow/multibranch/SCMBinder.java
Closing this PR in preference to PR#59 |
Adds support to configure the location and name of the Jenkinsfile.
I've tested it with both different file names and sticking Jenkinsfile in a subfolder; my test-multibranch repo shows the test scenarios.
One thing I haven't got working is have the descriptor in SCMBinder return the configured script path as part of its display name.