-
Notifications
You must be signed in to change notification settings - Fork 59
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
[Bug]: JTE 2.4 doesn't not resolve scriptPath correctly #267
Comments
i'm not sure i'm following. |
Hi @steven-terrana, [JTE] -- file path: pipeline_config.groovy [JTE] Pipeline Configuration Modifications [JTE] Configurations Added: [JTE] - libraries.common set to [:] [JTE] - template_methods.prepare_shared_lib set to [:] [JTE] - template_methods.build set to [:] [JTE] - template_methods.cleanup set to [:] [JTE] - template_methods.publish set to [:] [JTE] - template_methods.extra_step set to [:] [JTE] - template_methods.mailing set to [:] [JTE] Configurations Deleted: None [JTE] Configurations Changed: None [JTE] Configurations Duplicated: None [JTE] Configurations Ignored: None [JTE] Subsequent May Merge: [JTE] - libraries [JTE] Subsequent May Override: None [JTE] Loading Library common [JTE] -- scm: git https://github.com/NHLJang/JTE-lib-source.git [JTE] Template Primitives are overwriting Jenkins steps with the following names: [JTE] 1. build [JTE] Jenkinsfile does not exist. [JTE] -- scm: git https://github.com/NHLJang/JTE-lib-source.git java.lang.Exception: Could not determine pipeline template. If I would change the name of template file in JTE library source, from "BuildPipelineTemplate" into "Jenkinsfile" (switch to default-script-path branch), then the template would be "resolved", without me touching consumer project's pipeline_config.groovy , or "Build Configuration" scriptPath (still be "BuildPipelineTemplate"). [JTE] Obtained Template (hide) [JTE] -- scm: git https://github.com/NHLJang/JTE-lib-source.git [JTE] -- file path: Jenkinsfile Thanks for your attention 😃 |
This is what I've meant with "scriptPath does not get propagated to parent Governance Tier". I create a use-scm-jenkinsfile branch, where I set allow_scm_jenkinsfile = true and naming a custom Jenkinsfile, scriptPath/file path seems to be resolved correcty : [JTE] Obtained Repository Jenkinsfile [JTE] -- scm: git https://github.com/NHLJang/JTE-consumer-project.git [JTE] -- file path: BuildPipelineTemplate So looks like only when I try to refer to BuildPipelineTemplate in parent tier, which is the JTE library source in this case, the scriptPath won't be taken into account, but fallback to "Jenkinsfile" solely. |
ah i think i see the problem. Changing the If you want to change the path of the Pipeline Template in the Governance Tier(JTE-lib-source) then you'd need to use a Named Pipeline Template by putting
|
Hi @steven-terrana, |
I have the exact same problem where I upgraded the plugin to 2.4 and none of my multibranch jobs were working anymore due to the fact that these custom paths were always referenced by default in the source (app project) compared to a separate governance repository with all the JTE resources. Had to rollback for the time being, but I thought the context of this change was that the |
The It only changes the paths within the source repository for the Pipeline Template and the Pipeline Configuration. It's always the case that Governance Tiers are structured as:
where the Pipeline Configuration can declare I will update the Help Text provided in the Jenkins UI to be more clear for those inputs. |
If you insist, then, I don't see JTE brings up any conveniences for managing different pipelines(s) within one project repository ,which usually be a choice for development strategy, where only one single value for Thanks. |
Jenkins Version
2.303.3
JTE Version
2.3
Bug Description
This pull request #252 was told to give JTE the ability to change the scriptPath/Pipeline Template Path, but JTE seems to still try resolving "Jenkinsfile" default name.
I'm using MultibranchPipelineJob and would want to have multiple Template for Build/Nightly/Release multibranch job. Single pipeline_config.groovy could not achieve this IMHO. And it seems we can not have pipeline_config.groovy location to be different between Gorvernance Tier/JTE Configuration repo and project repo, am I correct?
EDIT: Looks like the issue should be rephrased as "scriptPath does not get propagated to parent Governance tier" I assume. Changing scriptPath works for client project, but if we turn off allow_scm_jenkinsfile to use the Template Configuration repo, Jenkinsfile still be the default scriptPath.
Relevant log output
Steps to Reproduce
Jenkins Template repository as follows:
- BuildPipelineTemplate
- pipeline_config.groovy
Project repository as follows:
- pipeline_config.groovy
The text was updated successfully, but these errors were encountered: