diff options
-rwxr-xr-x | automated/utils/upload-to-artifactorial.sh | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/automated/utils/upload-to-artifactorial.sh b/automated/utils/upload-to-artifactorial.sh index be307bf..a992b27 100755 --- a/automated/utils/upload-to-artifactorial.sh +++ b/automated/utils/upload-to-artifactorial.sh @@ -24,18 +24,18 @@ if [ -z "${URL}" ]; then exit 0 fi -if [ -z "${TOKEN}" ]; then - return=$(curl -F "path=@${ATTACHMENT}" "${URL}") -else - return=$(curl -F "path=@${ATTACHMENT}" -F "token=${TOKEN}" "${URL}") -fi +if which lava-test-reference; then + if [ -z "${TOKEN}" ]; then + return=$(curl -F "path=@${ATTACHMENT}" "${URL}") + else + return=$(curl -F "path=@${ATTACHMENT}" -F "token=${TOKEN}" "${URL}") + fi -if echo "${return}" | grep "${ATTACHMENT}"; then - if which lava-test-reference; then + if echo "${return}" | grep "$(basename "${ATTACHMENT}")"; then lava-test-reference "test-attachment" --result "pass" --reference "https://archive.validation.linaro.org/artifacts/${return}" else - echo "test-attachment skip" | tee -a "${RESULT_FILE}" + echo "test-attachment fail" | tee -a "${RESULT_FILE}" fi else - echo "test-attachment fail" | tee -a "${RESULT_FILE}" + echo "test-attachment skip" | tee -a "${RESULT_FILE}" fi |