diff options
author | Corentin LABBE <clabbe@baylibre.com> | 2019-09-11 20:49:34 +0200 |
---|---|---|
committer | Corentin LABBE <clabbe@baylibre.com> | 2019-09-13 09:14:40 +0200 |
commit | 29d66a104a35cbf35fcb39503bed0d46380a4a86 (patch) | |
tree | c70c7369567f6b33c01c7a530f6ed189a4aad075 /jjb | |
parent | 1d779c8531f5e6ba562d76a2347dde464334c2d0 (diff) |
SPEC-2703: do not fail with set -xe
This patch move the grepping test inside the if for not failling due to
set -xe
For the same reason, harden the code checking if git clone was
successfull.
Change-Id: Idb0619c4e90c9a3a0654a024fbd2166e49df98c6
Bug-AGL: SPEC-2703
Signed-off-by: Corentin LABBE <clabbe@baylibre.com>
Diffstat (limited to 'jjb')
-rw-r--r-- | jjb/common/include-agl-lava-jobs-submit.sh | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/jjb/common/include-agl-lava-jobs-submit.sh b/jjb/common/include-agl-lava-jobs-submit.sh index 82482130..dbb1f93e 100644 --- a/jjb/common/include-agl-lava-jobs-submit.sh +++ b/jjb/common/include-agl-lava-jobs-submit.sh @@ -68,25 +68,25 @@ echo "####" handle_skiplist() { SKIPLIST=skiplist # detect job type (apps vs non-apps) and get skiplist - echo $JOB_NAME | grep -q 'ci-platform' - if [ $? -eq 0 ];then - git clone https://${GERRIT_HOST}/gerrit/src/qa-testdefinitions.git - if [ $? -ne ];then + if [ ! -z "$(echo $JOB_NAME | grep 'ci-platform')" ];then + git clone https://${GERRIT_HOST}/gerrit/src/qa-testdefinitions.git || true + if [ ! -e qa-testdefinitions ];then echo "ERROR: fail to get qa-testdefinitions" - return 1 + return 0 fi SKIPDIR=qa-testdefinitions/skiplists/ SKIPFILE=common CK_REPO_NAME="qa-testdefinitions" else - git clone https://${GERRIT_HOST}/gerrit/${GERRIT_PROJECT}.git - if [ $? -ne ];then + git clone https://${GERRIT_HOST}/gerrit/${GERRIT_PROJECT}.git || true + # GERRIT_PROJECT could have a / in it + CK_REPO_NAME="$(basename ${GERRIT_PROJECT})" + if [ ! -e $CK_REPO_NAME ];then echo "ERROR: fail to get $GERRIT_PROJECT" - return 1 + return 0 fi - SKIPDIR=${GERRIT_PROJECT}/ + SKIPDIR=${CK_REPO_NAME}/ SKIPFILE=.aglci - CK_REPO_NAME="${GERRIT_PROJECT}" fi for skipfile in $SKIPFILE $MACHINE ${GERRIT_PROJECT} do @@ -111,8 +111,7 @@ handle_skiplist() { do # Check if fail are "normal/accepted" TESTNAME=$(echo $testline | cut -d' ' -f2) - grep -q $TESTNAME $SKIPLIST - if [ $? -ne 0 ];then + if [ -z "$(grep $TESTNAME $SKIPLIST)" ];then echo "DEBUG: $TESNAME not in skiplist" GOODJOB=0 else |