Dispatch publish job before retrigger 39/84439/9
authorAleksander Mistewicz <a.mistewicz@samsung.com>
Thu, 18 Aug 2016 12:43:37 +0000 (14:43 +0200)
committerAleksander Mistewicz <a.mistewicz@samsung.com>
Tue, 6 Dec 2016 15:37:14 +0000 (16:37 +0100)
If failure occured job was retriggered until FAIL_CNT was exceeded at
the start what created jobs that only triggered publishing of failure.

Raise FAIL_CNT max value to 2.

Change-Id: I3772ba293f0749b8a2b1d4c436c5c36e0d68c1fb
Signed-off-by: Aleksander Mistewicz <a.mistewicz@samsung.com>
tsp/jobs/common_prep_flash_conf.sh

index 960c75f..0c3dab0 100755 (executable)
@@ -48,17 +48,16 @@ retrigger() {
     # Add job back to the queue
     echo "Retrigger... ($1)"
     echo "FAILED 1" > sysctl.result
+    if [ "$FAIL_CNT" -ge 3 ]; then
+        # Trigger publish job
+        tspwb -L PUBLISH sh "${TSP_DIR}/jobs/publish.sh" "$BUILD_NR" "$TARGET"
+        exit 1
+    fi
     tsrun_target "${TARGET}" -L "RETRIGGERED_$(echo "$TARGET" | tr '[:lower:]' '[:upper:]')_PREPARE_FLASH_CONF" \
         sh "${TSP_DIR}/jobs/common_prep_flash_conf.sh" "$BUILD_NR" "${TARGET}" "$((FAIL_CNT + 1))"
     exit 0
 }
 
-if [ "$FAIL_CNT" -ge 2 ]; then
-    # Trigger publish job
-    tspwb -L PUBLISH sh "${TSP_DIR}/jobs/publish.sh" "$BUILD_NR" "$TARGET"
-    exit 1
-fi
-
 # Create and clean required directories on remote machine (tl-runner)
 ssh tl-runner "rm -rf \"${WORKDIR_REMOTE}\"; mkdir -p \"${WORKDIR_REMOTE}\"" || retrigger "ssh: remote ws cleanup failed"