X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Fjenkins-configure-clouds.sh;h=e5dba5466ac867e4b8652121c18575fc66651220;hb=8285615e111cae15f76eba24e5720068d16e778f;hp=20092adbb7137b8cfe64dde33e55f081429af275;hpb=e194613aea597ec57b65d169b9ba996eab9e6074;p=releng%2Fglobal-jjb.git diff --git a/shell/jenkins-configure-clouds.sh b/shell/jenkins-configure-clouds.sh index 20092adb..e5dba546 100644 --- a/shell/jenkins-configure-clouds.sh +++ b/shell/jenkins-configure-clouds.sh @@ -46,18 +46,15 @@ silos="${jenkins_silos:-jenkins}" set -eu -o pipefail -os_plugin_version="$(lftools jenkins plugins list \ - | grep -i 'OpenStack Cloud Plugin')" - testversion() { local current_val="$1" operator="$2" test_value="$3" awk -vv1="$current_val" -vv2="$test_value" 'BEGIN { split(v1, a, /\:/); - if (a[2] == '$test_value') { - exit (a[2] == '$test_value') ? 0 : 1 + if (a[2] == '"$test_value"') { + exit (a[2] == '"$test_value"') ? 0 : 1 } else { - exit (a[2] '$operator' '$test_value') ? 0 : 1 + exit (a[2] '"$operator"' '"$test_value"') ? 0 : 1 } }' } @@ -319,6 +316,11 @@ for silo in $silos; do export JENKINS_USER export JENKINS_PASSWORD + # JENKINS_{URL,USER,PASSWORD} env vars are required for the "lftools jenkins + # plugins list" call + os_plugin_version="$(lftools jenkins plugins list \ + | grep -i 'OpenStack Cloud Plugin')" + echo "-----> Groovy script $script_file" for cloud in "${clouds[@]}"; do cfg_dir="${cloud}" @@ -327,11 +329,14 @@ for silo in $silos; do mkdir -p "$(dirname "$insert_file")" rm -f "$insert_file" - echo "" >> "$insert_file" - echo "//////////////////////////////////////////////////" >> "$insert_file" - echo "// Cloud config for $(basename "$cloud")" >> "$insert_file" - echo "//////////////////////////////////////////////////" >> "$insert_file" - echo "" >> "$insert_file" + { + echo "" + echo "//////////////////////////////////////////////////" + echo "// Cloud config for $(basename "$cloud")" + echo "//////////////////////////////////////////////////" + echo "" + } >> "$insert_file" + echo "templates = []" >> "$insert_file" mapfile -t templates < <(find "$cfg_dir" -maxdepth 1 -not -type d -not -name "cloud.cfg")