job-template defaults not recognized

13 views
Skip to first unread message

Hussein Kadiri

unread,
Jul 10, 2024, 5:54:22 PM7/10/24
to jenkins-job-builder
I have an error where the default variable from a job-template is not recognized.

Here's a sample template:
- job-template:
    package-suffix-in-job-name: ''
    name: 'some-{package}'
    package-filename: 'default'
    parameters:
      - string:
          name: PACKAGE-FILENAME
          default: '{package-filename}'
    description: |
      <p>This job builds the <b>{package-filename}</b> for {package}

- project:
    name: 'publish-me'
    package: blah
   jobs:
     -  'some-{package}'


When i build, i get the error:
jenkins_jobs.errors.JenkinsJobsException: package-filename parameter missing to format <p>This job builds the <b>{package-filename}</b> for {package}

But if I set the package-filename in project, it works. Its like it doesn't see the default package-filename set in job-template. What am I doing wrong?

Tony Chia

unread,
Jul 14, 2024, 7:09:29 PM7/14/24
to jenkins-job-builder
I am not able to reproduce the error.

The only issue i see is the ident issue under project. Once that is fixed, the subsitution worked for me.
Reply all
Reply to author
Forward
0 new messages