diff options
author | Chase Qi <chase.qi@linaro.org> | 2017-02-28 10:56:46 +0800 |
---|---|---|
committer | Chase Qi <chase.qi@linaro.org> | 2017-02-28 10:56:46 +0800 |
commit | f48aae09bf0133c409c92e8caab8c598b9ce63d2 (patch) | |
tree | c7256ed8c612ec849a7726d7389d712fc3f6fa2a /automated | |
parent | e01e9386133050ad79bab2a757ca70d645f5091e (diff) |
automated: utils: improve upload-to-artifactorial.sh
* Only do attachment uploading in LAVA
* Use basename of "${ATTACHMENT}" in case it includes a path
Change-Id: I4893da2b16766a64152804be47ee8853a162534a
Signed-off-by: Chase Qi <chase.qi@linaro.org>
Diffstat (limited to 'automated')
-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 |