Skip to content
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

Closed
wants to merge 11 commits into from
Closed

Conversation

dbut023
Copy link
Contributor

@dbut023 dbut023 commented Dec 15, 2016

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.

@jglick
Copy link
Member

jglick commented Dec 16, 2016

IIRC there is already a plugin that does something much like this; would prefer to keep this plugin simple and add extended behaviors there.

@kuhnroyal
Copy link

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.

@jglick
Copy link
Member

jglick commented Dec 16, 2016

https://github.com/jenkinsci/pipeline-multibranch-defaults-plugin

@leewinder
Copy link

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
@dbut023
Copy link
Contributor Author

dbut023 commented Dec 21, 2016

Lee's mirrored my thoughts too. I'm not seeing how this PR slots in with the functionality of multibranch-defaults.

@kuhnroyal
Copy link

I have to agree, the multibranch-defaults-plugin doesn't solve my problems.

@vtintillier
Copy link
Member

vtintillier commented Jan 7, 2017

So is there anything that prevents merging this PR?

@leewinder
Copy link

workflow-multibranch.hpi.zip

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...

@y3ti
Copy link

y3ti commented Jan 12, 2017

Other arguments for merge this patch:

@crummy
Copy link

crummy commented Jan 13, 2017

This is a very useful feature for monorepos. Hoping to see it merged.

@matejsp
Copy link

matejsp commented Jan 16, 2017

Is there any reason for this to not be merged?
It's the killer feature for multiproduct git repos.

@psufoxman
Copy link

I will add my vote as well to have this merged. Would like to have this on the open source.

@teramawi
Copy link

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'd greatly appreciate it, if this feature could find its way into the plugin.

@malinoff
Copy link

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 ops-tools directory (including Jenkinsfile, of course).

@dedalusj
Copy link

Any chance this pull request is going to be merged?

There have been a few use cases already outlined in the comments.

@konetzed
Copy link

konetzed commented Feb 24, 2017

Is there anyway with this add on to have jenkins create multiple jobs based off a directory structure like below

repo/dir1
     dir2
     dir3 
     dirN

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?
Thanks

@ajohnstone
Copy link

@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.

@ghost
Copy link

ghost commented Mar 3, 2017

This is very important and useful feature for many people.
@jglick can u merge it, please?

Copy link
Member

@jglick jglick left a 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);
Copy link
Member

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(){
Copy link
Member

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){
Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also wrong.

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
@dbut023
Copy link
Contributor Author

dbut023 commented Mar 13, 2017

Closing this PR in preference to PR#59

@dbut023 dbut023 closed this Mar 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.