Hi, Anand.
JJB uses curly braces for variables. So, it assumes that there are variables inside, and tries to expand them. To avoid that, you can just escape them by doubling, like this:
- shell: |
find $VAR -type f -mtime +60 -exec rm -f {{}} \\;
echo "This is expanded JJB variable
'var': {var}"
But I suggest to wrap bash scripts, json and other texts often containing curly braces with `!j2:` prefix. This way, JJB will expect Jinja2 template inside prefixed text, which uses double curly braces for variables:
- shell: !j2: |
find $VAR -type f -mtime +60 -exec rm -f {} \\;
echo "This is expanded JJB variable
'var': {{ var }}"
By the way, can you provide JJB source snippet which causes this
failure? This looks like a JJB bug - it should not fail in those
cases, but show proper error. And which JJB version do you use?
Vsevolod.
--
You received this message because you are subscribed to the Google Groups "jenkins-job-builder" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkins-job-bui...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkins-job-builder/a65ae7e6-d680-4979-a269-5ec05dd669f7n%40googlegroups.com.