jjb/common: lava-jobs-submit: fix email token check 47/21247/1
authorKevin Hilman <khilman@baylibre.com>
Tue, 16 Apr 2019 17:14:40 +0000 (10:14 -0700)
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>
Fri, 3 May 2019 15:19:48 +0000 (15:19 +0000)
Fix the logic to check if the email auth token is present.

While at it, make output more verbose for easier debug.

Signed-off-by: Kevin Hilman <khilman@baylibre.com>
(cherry picked from commit b9f7f8928ab26f15f0950d00a7f2417ffa204755)

Change-Id: Iceb00e5617cbfb787353c7caf05e5d00e9512d70

jjb/common/include-agl-lava-jobs-submit.sh

index 93f8b70..c221b7e 100644 (file)
@@ -90,7 +90,8 @@ echo "####"
 
 # ask for email report
 
-if [ -z "$KCI_EMAIL_AUTH_TOKEN" ]; then
+set -x
+if [ -n "$KCI_EMAIL_AUTH_TOKEN" ]; then
        KCI_API='https://kernelci.dev.baylibre.com:8081'
        TREE_NAME=$(grep kernel.tree: $JOB_FILE_NEW | sed 's,[[:space:]],,g' | cut -d: -f2)
        BRANCH=$(grep git.branch: $JOB_FILE_NEW | sed 's,[[:space:]],,g' | cut -d: -f2)
@@ -110,6 +111,8 @@ if [ -z "$KCI_EMAIL_AUTH_TOKEN" ]; then
        fi
        set -e
 fi
+set +x
+
 # after one successful submit, we're done
 if [ x"$status" = x"Complete" ]; then
     exit 0