X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=jjb-compare-xml.sh;h=98ad4194fcf095e1a273d0a9b300c15234971e8d;hb=8901fe0bee2fecb6b32accffd9f952d46da59a38;hp=e29c1fa3c687baa568fb20879537fdedf4b497d3;hpb=3fcd35dc6a2ff7decaa05bacdfa9d2807a6323f5;p=releng%2Fglobal-jjb.git diff --git a/jjb-compare-xml.sh b/jjb-compare-xml.sh index e29c1fa3..98ad4194 100755 --- a/jjb-compare-xml.sh +++ b/jjb-compare-xml.sh @@ -13,7 +13,7 @@ # from global-jjb's origin/master branch. test_dir=$(mktemp -d) -script_dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) +script_dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/jjb expected_xml_dir="$(mktemp -d -t gjjb-XXXXXXXX)" echo "Script Directory: $script_dir" @@ -25,7 +25,8 @@ gittmp="$(mktemp -d)" git worktree add --detach "$gittmp" origin/master pushd "$gittmp" || exit echo "Generating expected XML." -jenkins-jobs test --recursive -o "$expected_xml_dir" "$gittmp":.jjb-test > /dev/null 2>&1 +jenkins-jobs test --recursive -o "$expected_xml_dir" \ + "$gittmp":.jjb-test > /dev/null 2>&1 popd || exit rm -r "$gittmp" @@ -42,10 +43,21 @@ for xml in "$test_dir"/*; do fi done +echo "Checking for double curly braces..." +mapfile -t xml_files < <(find "$test_dir" -type f) +for xml in "${xml_files[@]}"; do + if grep '{{' "$xml"; then + echo "ERROR: Double curly braces discovered in output XML." + exit 1 + fi +done +echo "No double curly braces found." + # Cleanup rm -rf "$test_dir" "$expected_xml_dir" if $fail; then - echo "WARN: Differences detected. Check above for jobs that have been changed." + echo "WARN: Differences detected." \ + "Check above for jobs that have been changed." exit 0 fi