From: Thanh Ha Date: Tue, 5 Mar 2019 00:55:02 +0000 (-0500) Subject: Search for CFG & YAML files in specific dirs X-Git-Tag: v0.33.0~6 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F62%2F14762%2F1;p=releng%2Fglobal-jjb.git Search for CFG & YAML files in specific dirs These file locations are standard locations in our CI setup so be specific of where to search for them. This prevents the scripts from picking up data from test files in global-jjb. Change-Id: Ia486ae8704b77f9303b5a2e54c4ffaf5de41aef8 Signed-off-by: Thanh Ha --- diff --git a/shell/openstack-protect-in-use-images.sh b/shell/openstack-protect-in-use-images.sh index a23a4ed8..4d9a2cc8 100644 --- a/shell/openstack-protect-in-use-images.sh +++ b/shell/openstack-protect-in-use-images.sh @@ -24,9 +24,9 @@ set -eu -o pipefail declare -a images declare -a cfg_images declare -a yaml_images -readarray -t cfg_images <<< "$(grep -r IMAGE_NAME --include \*.cfg \ +readarray -t cfg_images <<< "$(grep -r IMAGE_NAME --include \*.cfg jenkins-config \ | awk -F'=' '{print $2}' | sort -u)" -readarray -t yaml_images <<< "$(grep -r 'ZZCI - ' --include \*.yaml \ +readarray -t yaml_images <<< "$(grep -r 'ZZCI - ' --include \*.yaml jjb \ | awk -F": " '{print $3}' | sed "s:'::;s:'$::;/^$/d" | sort -u)" mapfile -t images < <(for R in "${cfg_images[@]}" "${yaml_images[@]}" ; do echo "$R" ; done | sort -u)