Is it possible to set default values for macros, in a similar way to how
job-templates work? For example, this job-template allows you to override
the 'target' variable, but also has a default value of 'World':
- job-template:
target: 'World'
name: 'hello-{target}'
builders:
- shell: 'echo "Hello, {target}!"'
- project:
name: 'example'
jobs:
- 'hello-{target}'
- 'hello-{target}':
target: 'User'
Unfortunately, this doesn't seem to work with macros. I'm trying to
configure a Git SCM, which has a default branch (master) but can also be
overridden. I've tried a similar approach as above:
- scm:
name: example
branches:
- master
scm:
- git:
url: [email protected]:user/example.git
branches: '{branches}'
In this case, passing a branches value works, but the default isn't used if
no variable is passed. (Instead '{branches}' is split into individual
characters!)
I've also tried using a custom 'defaults' but the same behaviour occurs as
above.
If this isn't currently possible, does anyone have insight into how difficult
this might be to add. Would a patch for such functionality be welcomed?
Ben
_______________________________________________
OpenStack-Infra mailing list
[email protected]
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-infra