diff options
author | Chase Qi <chase.qi@linaro.org> | 2017-10-11 15:25:59 +0800 |
---|---|---|
committer | Chase Qi <chase.qi@linaro.org> | 2017-10-11 15:25:59 +0800 |
commit | 5a6acc480c30c3e7f135d1d0ac86e39389d46cca (patch) | |
tree | bc7087912f6df4eb48f829de69f14278c7311203 | |
parent | 6dd435881e481d232dc05b963bbd65f10b977b93 (diff) |
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 <chase.qi@linaro.org>
-rwxr-xr-x | automated/utils/upload-to-artifactorial.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/automated/utils/upload-to-artifactorial.sh b/automated/utils/upload-to-artifactorial.sh index 7b5c0c82..234c6259 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" |