From 5a6acc480c30c3e7f135d1d0ac86e39389d46cca Mon Sep 17 00:00:00 2001 From: Chase Qi Date: Wed, 11 Oct 2017 15:25:59 +0800 Subject: utils: filter 'find /lava-*' output to get test directory only Except LAVA test directories like '/lava-[0-9]+', the current approach also captures unwanted directories like '/lava-lxc' directory. When this case happen, it skips test attachment publishing as there is no 'serets' file in non-test directory. With '-regex' option, it filters find output and keep LAVA test directories only. Change-Id: I77f9fc490790a7eebbaaf353e9c4ed26ddad9879 Signed-off-by: Chase Qi --- automated/utils/upload-to-artifactorial.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'automated') diff --git a/automated/utils/upload-to-artifactorial.sh b/automated/utils/upload-to-artifactorial.sh index 7b5c0c8..234c625 100755 --- a/automated/utils/upload-to-artifactorial.sh +++ b/automated/utils/upload-to-artifactorial.sh @@ -27,7 +27,7 @@ fi if which lava-test-reference; then # If 'ARTIFACTORIAL_TOKEN' defined in 'secrects' dictionary defined in job # definition file, it will be used. - lava_test_dir="$(find /lava-* -maxdepth 0 -type d 2>/dev/null | sort | tail -1)" + lava_test_dir="$(find /lava-* -maxdepth 0 -type d -regex '/lava-[0-9]+' 2>/dev/null | sort | tail -1)" if test -f "${lava_test_dir}/secrets" && grep -q "ARTIFACTORIAL_TOKEN" "${lava_test_dir}/secrets"; then # shellcheck disable=SC1090 . "${lava_test_dir}/secrets" -- cgit v1.2.3