set -euf -o pipefail
# shellcheck disable=SC1090
-source ~/lf-env.sh
+. ~/lf-env.sh
-lf-activate-venv jenkins-job-builder
+lf-activate-venv --python python3 --venv-file /tmp/.jjb_venv \
+ jenkins-job-builder
-yes | jenkins-jobs -s sandbox delete-all
+# 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
- view:
- name: All
+ name: all
view-type: all
EOF
jenkins-jobs -s sandbox update -v all-view.yaml