X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Fopenstack-protect-in-use-images.sh;h=0d1624ca92c249512275df4226d3b6ef5b05d72f;hb=refs%2Fchanges%2F50%2F72650%2F2;hp=e2299060e678aa6b6cae766b50b85ff8753cf1a5;hpb=5a6965f43f220bf6002bfde60897afd216f52ab0;p=releng%2Fglobal-jjb.git diff --git a/shell/openstack-protect-in-use-images.sh b/shell/openstack-protect-in-use-images.sh index e2299060..0d1624ca 100644 --- a/shell/openstack-protect-in-use-images.sh +++ b/shell/openstack-protect-in-use-images.sh @@ -19,20 +19,28 @@ set -eu -o pipefail echo "---> Protect in-use images" os_cloud="${OS_CLOUD:-vex}" +# shellcheck disable=SC1090 +source ~/lf-env.sh + +lf-activate-venv --python python3 "lftools[openstack]" \ + kubernetes \ + python-heatclient \ + python-openstackclient + images=() while read -r -d $'\n' ; do images+=("$REPLY") done < <(grep -r IMAGE_NAME --include \*.cfg jenkins-config \ - | awk -F'=' '{print $2}' \ - | sort -u) + | awk -F'=' '{print $2}' \ + | sort -u) jjbimages=() while read -r -d $'\n' ; do jjbimages+=("$REPLY") done < <(grep -r 'ZZCI - ' --include \*.yaml jjb \ - | awk -F": " '{print $3}' \ - | sed -e "s:'::;s:'$::;/^$/d" -e 's/^"//' -e 's/"$//' \ - | sort -u) + | awk -F": " '{print $3}' \ + | sed -e "s:'::;s:'$::;/^$/d" -e 's/^"//' -e 's/"$//' \ + | sort -u) if ! [[ ${#images[@]} -eq 0 ]]; then echo "INFO: There are images to protect defined in jenkins-config."