Hi all
I’m trying to create a Jenkins job from a Backstage template using the jenkins:job:create action.
My file structure looks like this:
backstage-app-root/
templates/microservices/springboot/
├─ template.yaml
└─ skeleton/
└─ jenkins-config/
└─ config.xml.hbs
In my template.yaml, I have a step like:
- id: prepare-jenkins-config
name: Prepare Jenkins config
action: fetch:template
input:
url: ./skeleton/jenkins-config/config.xml.hbs
targetPath: ./jenkins/config.xml
values:
repoUrl: ${{ parameters.repoUrl }}
Then I call jenkins:job:create with:
- id: create-job
name: Create Jenkins Pipeline
action: jenkins:job:create
input:
configPath: ./jenkins/config.xml
jobName: ${{ parameters.component_id }}
folderName: CCoE
Issue: When I run the template, Jenkins job creation fails with this error:
ENOENT: no such file or directory,
open 'C:\Users\ss6647\AppData\Local\Temp\1\167e4a82-cb03-4a12-81a6-f81ce812881f\skeleton\jenkins-config\config.xml.hbs'
It looks like the scaffolder is still trying to read the .hbs file from the temp workspace instead of the rendered config.xml.
Has anyone run into this? Do I need to fetch the whole jenkins-config folder instead of just the .hbs file, or am I pointing configPath incorrectly?