jjb/common: lava-jobs-submit: fix email token check 62/21062/1
authorKevin Hilman <khilman@baylibre.com>
Tue, 16 Apr 2019 17:14:40 +0000 (10:14 -0700)
committerKevin Hilman <khilman@baylibre.com>
Tue, 16 Apr 2019 17:15:22 +0000 (10:15 -0700)
Fix the logic to check if the email auth token is present.

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

Change-Id: I3459396c4fca66ca7c1f4a4fd23d65b7019ed6d6
Signed-off-by: Kevin Hilman <khilman@baylibre.com>
jjb/common/include-agl-lava-jobs-submit.sh

index 22dc0c3..5072cbf 100644 (file)
@@ -55,7 +55,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)
@@ -70,6 +71,8 @@ if [ -z "$KCI_EMAIL_AUTH_TOKEN" ]; then
                echo "There is no test plan identified"
        fi
 fi
+set +x
+
 # after one successful submit, we're done
 if [ x"$status" = x"Complete" ]; then
     exit 0