You do not have permission to delete messages in this group
Link
Report message as abuse
Sign in to report message as abuse
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to jenkins-job-builder
We would like to utilize job-templates that only vary by a set of options we'd further like to keep in "defaults" objects. However, it appears that the "defaults" option for jobs/job-templates expects a static string instead of a variable.
I suspect that 'defaults:' is fetched before variable replacement occurs. Is there another way to achieve what we're trying to do? I know we can put those vars into the project object but we also potentially want them to be usable by other projects/jobs/job-templates.
Thanks
Andrew Grimberg
unread,
Jul 25, 2022, 11:44:22 AM7/25/22
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Link
Report message as abuse
Sign in to report message as abuse
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Lesley Kimmel, jenkins-job-builder
Variable replacement only happens inside of quoted strings. You've got
two that are not quoted.
The name inside of the job template and the call to the job definition.
Though I haven't tried to do a default that is used in job names, this
should correct the issue for you though.
--
Andrew J Grimberg
Manager Release Engineering
The Linux Foundation
NOTICE: The Linux Foundation supports their employees with flexible work
hours. If you recieve mail from me outside of standard business hours
please be aware that I do not expect a response until the next standard
business day.
You do not have permission to delete messages in this group
Link
Report message as abuse
Sign in to report message as abuse
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to jenkins-job-builder
Andy;
Thank you for the reply. However, I have to contradict you here. I have plenty of jobs that don't place replacement variables inside of quotes. The replacement still happens just fine and my jobs are rendered as expected. As per the YAML spec I have to quote them when the curly brace would immediately follow a key because it would otherwise be interpreted as the start of an object instead of a string. Hence why I quoted the variable after 'defaults: ' but not in other places.