Dont fail the CI when build-info is unavaillable 88/22388/3
authorCorentin LABBE <clabbe@baylibre.com>
Wed, 11 Sep 2019 18:18:12 +0000 (20:18 +0200)
committerCorentin LABBE <clabbe@baylibre.com>
Thu, 12 Sep 2019 04:46:45 +0000 (06:46 +0200)
This patchs made the download of build-info non-fatal.
The build-info is used before running releng-scripts and for email
report.

Bug-AGL: SPEC-2177
Change-Id: I8ffaacafce472faa32dc06ecac486be037938f67
Signed-off-by: Corentin LABBE <clabbe@baylibre.com>
jjb/common/include-agl-run-test-short-guppy.sh
jjb/common/include-agl-run-test-short-halibut.sh
jjb/common/include-agl-run-test-short.sh
jjb/common/include-agl-send-email-report.sh

index c638521..35f4fe4 100644 (file)
@@ -12,7 +12,7 @@ UPLOAD_URL=${UPLOAD_URL_BASE}/${RELEASE_BRANCH}/${RELEASE_VERSION}/${MACHINE}/de
 
 cd $REPODIR
 
-wget -q ${UPLOAD_URL}/build-info
+wget -q ${UPLOAD_URL}/build-info || echo "ERROR: fail to download ${UPLOAD_URL}/build-info"
 if [ -e build-info ]; then
        cat build-info
        source build-info
index c638521..35f4fe4 100644 (file)
@@ -12,7 +12,7 @@ UPLOAD_URL=${UPLOAD_URL_BASE}/${RELEASE_BRANCH}/${RELEASE_VERSION}/${MACHINE}/de
 
 cd $REPODIR
 
-wget -q ${UPLOAD_URL}/build-info
+wget -q ${UPLOAD_URL}/build-info || echo "ERROR: fail to download ${UPLOAD_URL}/build-info"
 if [ -e build-info ]; then
        cat build-info
        source build-info
index 6dc1c79..f97218e 100644 (file)
@@ -12,7 +12,7 @@ UPLOAD_URL=${UPLOAD_URL_BASE}/${GERRIT_CHANGE_NUMBER}/${GERRIT_PATCHSET_NUMBER}/
 
 cd $REPODIR
 
-wget -q ${UPLOAD_URL}/build-info
+wget -q ${UPLOAD_URL}/build-info || echo "ERROR: fail to download ${UPLOAD_URL}/build-info"
 if [ -e build-info ]; then
        cat build-info
        source build-info
index 01daea3..84e3df8 100644 (file)
@@ -12,10 +12,12 @@ UPLOAD_URL=${UPLOAD_URL_BASE}/${GERRIT_CHANGE_NUMBER}/${GERRIT_PATCHSET_NUMBER}/
 
 set | grep MACH
 
-wget -q ${UPLOAD_URL}/build-info || exit 0
+send_email_report()
+{
+wget -q ${UPLOAD_URL}/build-info || echo "ERROR: send_email_report: failed to get build-info"
 
 if [ ! -s build-info ]; then
-       exit 0
+       return 0
 fi
        cat build-info
        source build-info
@@ -30,6 +32,9 @@ if [ -n "$KCI_EMAIL_AUTH_TOKEN" ]; then
            GIT_DESCRIBE=$DIST_BB_DISTRO_VERSION-${DIST_LAYERS_MD5:0:8}
        fi
        PLAN='agl-testplan'
-       curl -X POST -H "Authorization: $KCI_EMAIL_AUTH_TOKEN" -H "Content-Type: application/json" -d '{"job": "'$TREE_NAME'", "kernel": "'$GIT_DESCRIBE'", "git_branch": "'$BRANCH'", "report_type": "test", "plan": "'$PLAN'", "send_to": ["automotive-testreports@lists.linuxfoundation.org"], "format": ["txt"], "delay": 3600}' ${KCI_API}/send
+       curl -X POST -H "Authorization: $KCI_EMAIL_AUTH_TOKEN" -H "Content-Type: application/json" -d '{"job": "'$TREE_NAME'", "kernel": "'$GIT_DESCRIBE'", "git_branch": "'$BRANCH'", "report_type": "test", "plan": "'$PLAN'", "send_to": ["automotive-testreports@lists.linuxfoundation.org"], "format": ["txt"], "delay": 3600}' ${KCI_API}/send || echo "ERROR: send_email_report: curl"
        echo "The test email reportS will be sent with a delay of 1 hour "
 fi
+}
+
+send_email_report