jenkins-job-builder/tests/macros/fixtures/builder/multi-line-strings001.xml
Justin Stoller bf88fe32c1 Allow deep formatting of macro parameters
Prior to this patch macros serialized into a yaml document, a simple string
substitution was applied and then they were re-loaded into python. This
created several problems:
 - newlines are lost because the yaml loading was not respecting the
   newline settings of the original strings (Story: 1387060)
 - {obj:} notation was not working for macro parameters (Story: 2000254)
 - multiline strings passed into scripts will create a yaml syntax error
   when being re-loaded (unticketed)

This patch resolves these problems by replacing the previous interpolation
code with the more robust `deep_format` method. A side effect of this patch
is that there are now fewer disparate code paths for interpolating variables.

Change-Id: Ia06c98286537a50dc52c6e5e000b32ebc9e8ede2
Signed-off-by: Justin Stoller <justin.stoller@gmail.com>
2015-11-13 10:57:36 -08:00

36 lines
826 B
XML

<?xml version="1.0" encoding="utf-8"?>
<project>
<actions/>
<description>&lt;!-- Managed by Jenkins Job Builder --&gt;</description>
<keepDependencies>false</keepDependencies>
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
<concurrentBuild>false</concurrentBuild>
<canRoam>true</canRoam>
<properties/>
<scm class="hudson.scm.NullSCM"/>
<builders>
<hudson.tasks.Shell>
<command># Set environment variables
ENV_VAR_ONE=one
ENV_VAR_TWO=2
DIFFERENT_ENV_VAR=different
# Debug output
echo -e &quot;\n\n\n&quot;
sort | env
echo -e &quot;\n\n\n&quot;
# Test Command
bundle install
bundle exec rake test
</command>
</hudson.tasks.Shell>
</builders>
<publishers/>
<buildWrappers/>
</project>