#!/usr/bin/env bash
capture_result() {
local result=$1
export TRAVIS_JENKINS_RESULT=$(( ${TRAVIS_JENKINS_RESULT:-0} | $(($result != 0)) ))
}
export CI=1
export CONTINUOUS_INTEGRATION=1
export TRAVIS_JENKINS_RESULT=0
if [ $TRAVIS_JENKINS_RESULT -eq 0 ]; then
echo $ if true; then
true
fi
if test true; then
true
fi
fi
exit $TRAVIS_JENKINS_RESULT
There we can clearly see that the bug is caused by not quoting
and escaping script from .travis.yml when it is used as an
argument to echo. Without that the generated lines are
treated as a shell commands. Which is bad in itself, but in
this case the commands even have an invalid syntax. Which
ultimately leads to failed builds.
This
.travis.yml
:produces the following error:
Here is the generated build script:
There we can clearly see that the bug is caused by not quoting and escaping
script
from.travis.yml
when it is used as an argument toecho
. Without that the generated lines are treated as a shell commands. Which is bad in itself, but in this case the commands even have an invalid syntax. Which ultimately leads to failed builds.