jenkinsci / templating-engine-plugin

create tool-agnostic, templated pipelines to be shared by multiple teams
https://jenkinsci.github.io/templating-engine-plugin/latest/
Apache License 2.0
171 stars 59 forks source link

[Bug]: Not able to use custom pipeline_config #304

Closed davidthong closed 2 years ago

davidthong commented 2 years ago

Jenkins Version

Jenkins 2.303.2

JTE Version

2.4

Bug Description

We're trying to create a pipeline repository for JTE but make it extensible to handle different use cases. I know the default config that it looks for is pipeline_config.groovy but in the Build configuration we set the path to look for controller_pipeline_config.groovy.

Build is failing because it's looking for pipeline_config.groovy. Is it even possible to use a pipeline_config that's named differently than the default (pipeline_config.groovy) ? If it is supposed to work, any idea why it's not picking up the custom groovy config that's defined in the the build configuration?

Relevant log output

[JTE] pipeline_config.groovy does not exist. (hide)
[JTE] -- scm: git https://cscgithub.cscglobal.com/IAD/aap-ci-pipeline-config

Steps to Reproduce

  1. Create a JTE governance tier repo that contains default pipeline - Jenkinsfile and default configuration pipeline_config.groovy
  2. Rename the pipeline_config.groovy to something different ie controller_pipeline_config.groovy
  3. In Jenkins config for multi-branch pipeline, define a source repo (any), define JTE config with the gonvernance repo. In the build configuration -- Mode=Jenkins Templating Engine, Pipeline Template Path=Jenkinsfile, Pipeline Configuration Path=controller_pipeline_config.groovy
steven-terrana commented 2 years ago

Hey @davidthong

The Pipeline Configuration Path configuration only changes the resolution path within the application repository (the one pointed to for the Branch Source in the multibranch project).

If you're trying to use different pipeline configurations in a Governance Tier you'll need to use different Base Directories.