X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Fjenkins-sandbox-cleanup.sh;h=10f3b2919cd5b54fbf730b480d73a8da4046fe61;hb=9268e4ab2c79a5605c59865ac5dd96231de75518;hp=e97dbe4c05745739c1d5323fa2109c0161d45489;hpb=79c376c000d2996608b172d1a970f89a93ceff4d;p=releng%2Fglobal-jjb.git diff --git a/shell/jenkins-sandbox-cleanup.sh b/shell/jenkins-sandbox-cleanup.sh index e97dbe4c..10f3b291 100644 --- a/shell/jenkins-sandbox-cleanup.sh +++ b/shell/jenkins-sandbox-cleanup.sh @@ -11,12 +11,19 @@ # 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 view-type: all