X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Fjjb-verify-job.sh;h=5ed12e2a408e77db29ee20d55ce3d572b1b9e304;hb=568b22ef45e66def2e9b3361b3d438fd5b32fd97;hp=f38685f22bbd77bed1c81da38d7c785e1f23fa26;hpb=a99cfe8b7c3e3b33cf9f210a90c50ea65128b30e;p=releng%2Fglobal-jjb.git diff --git a/shell/jjb-verify-job.sh b/shell/jjb-verify-job.sh index f38685f2..5ed12e2a 100644 --- a/shell/jjb-verify-job.sh +++ b/shell/jjb-verify-job.sh @@ -10,21 +10,35 @@ ############################################################################## echo "---> jjb-verify-job.sh" -# Ensure we fail the job if any steps fail. -set -eu -o pipefail +set -eufo pipefail -jenkins-jobs -l DEBUG test --recursive -o archives/job-configs jjb/ +# shellcheck disable=SC1090 +source ~/lf-env.sh -# Sort job output into sub-directories. On large Jenkins systems that have -# many jobs archiving so many files into the same directory makes NGINX return -# the directory list slow. -pushd archives/job-configs -for letter in {a..z} -do - if [[ $(ls "$letter"* > /dev/null 2>&1) -eq 0 ]] - then - mkdir "$letter" - find . -maxdepth 1 -type f -name "$letter*" -exec mv {} "$letter" \; - fi -done -popd +lf-git-validate-jira-urls +lf-jjb-check-ascii + +lf-activate-venv jenkins-job-builder + +jenkins-jobs test --recursive -o archives/job-configs --config-xml jjb/ + +# Enable 'globbing' +set +f +# NGINX is very sluggish with directories containing large numbers of objects +# Add another directory level named {a..z} and move directories to them. +# Directories beginning with {0..9} or {A..Z} are left at the top level. +( cd archives/job-configs + for letter in {a..z}; do + if ls -d $letter* > /dev/null 2>&1; then + mkdir .tmp + mv $letter* .tmp + mv .tmp $letter + fi + done +) + +( cd archives + echo "INFO: Archiving $(find job-configs -name \*.xml | wc -l) job configurations" + tar -cJf job-configs.tar.xz job-configs + rm -rf job-configs +)