Hi we are trying to upgrade or configs from jjb 3.3.0 and I'm facing an error. I'm using a simple example just to show it.
# using !include in job-template
- job-template: !include: include002.yaml.inc
- project:
name: acc-cdi
jobs:
- test-gerrit
builders:
- shell:
!include-raw-verbatim: include-raw-vars.sh
With this simple config I get this error:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <jenkins_jobs.expander.StrExpander object at 0x7f215b12d1d0>
obj = '#!/bin/bash\n#\n# sample script to check that variables aren\'t expanded\n# when using the !include-raw-verbatim: app...} ${VAR2}"\n\n[[ -n "${VAR3}" ]] && {\n # this next section is executed as one\n echo "${VAR3}"\n exit 0\n}\n'
params = {'name': 'acc-cdi', 'template-name': 'test-gerrit'}, key_pos = <Pos /home/vseva/data/projects/jenkins-job-builder/tests/loader/fixtures/include002.yaml.inc:2:4>, value_pos = <Pos /home/vseva/data/projects/jenkins-job-builder/tests/loader/fixtures/include002.yaml.inc:3:6>
def __call__(self, obj, params, key_pos, value_pos):
try:
return self._formatter.format(str(obj), **params)
except JenkinsJobsException as x:
lines = str(obj).splitlines()
> start_ofs = value_pos.body.index(lines[0])
E ValueError: substring not found
jenkins_jobs/expander.py:66: ValueError
-----------------------------------------------------------------------------------------------------------------------------------
I would say this is a bug since parser is trying to expand something that is included via !include-raw-verbatim
Here are the tests I've created to verify this scenario[0]
Should I create a bug report or We are doing something wrong?
Cheers,
Victor