X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Fjenkins-sandbox-cleanup.sh;h=dc69e2b7ad9eab184eda277d0f250e78d3b9915b;hb=04853ec1c27444d494afae28e8c181b711280f4b;hp=e97dbe4c05745739c1d5323fa2109c0161d45489;hpb=ff9379ceded83ed982012970d1de2f4a7f0889f4;p=releng%2Fglobal-jjb.git diff --git a/shell/jenkins-sandbox-cleanup.sh b/shell/jenkins-sandbox-cleanup.sh index e97dbe4c..dc69e2b7 100644 --- a/shell/jenkins-sandbox-cleanup.sh +++ b/shell/jenkins-sandbox-cleanup.sh @@ -11,14 +11,21 @@ # Deletes all jobs on a Jenkins Sandbox system. echo "---> jenkins-sandbox-cleanup.sh" -set -eux -o pipefail +set -euf -o pipefail -bash -c "/usr/bin/yes 2>/dev/null || true" | jenkins-jobs -s sandbox delete-all +# shellcheck disable=SC1090 +. ~/lf-env.sh + +lf-activate-venv --python python3 --venv-file /tmp/.jjb_venv \ + jenkins-job-builder + +# jenkins-jobs does not always open 'stdin' which may cause 'yes' to fail +(yes || true) | jenkins-jobs -s sandbox delete-all # Recreate the All default view. -cat << EOF > all-view.yaml +cat << 'EOF' > all-view.yaml - view: - name: All + name: all view-type: all EOF jenkins-jobs -s sandbox update -v all-view.yaml