Add symlinks by sr/target 45/181845/1
authorAleksander Mistewicz <a.mistewicz@samsung.com>
Thu, 2 Nov 2017 11:53:43 +0000 (12:53 +0100)
committerAleksander Mistewicz <a.mistewicz@samsung.com>
Thu, 9 Nov 2017 13:46:45 +0000 (14:46 +0100)
Move terminal state actions to the end of script.

Change-Id: Ic5159f29fa36f70584533943c6a04830d4711dba

tsp/jobs/publish.sh

index 96ed6fa..c0e33c8 100755 (executable)
@@ -195,10 +195,28 @@ echo "OVERALL_TAG: $OVERALL_TAG"
 echo "TARGET: $TARGET"
 echo "PROFILE: $PROFILE"
 
+# Publish to database
+update_db "$SR" "$OVERALL_TAG" "$BUILD_NR" "$TARGET"
+
+# Remove all queued WWW jobs
+for i in $(tsresults | grep "queued.*WWW" | grep -o "^[0-9]*")
+do
+    tsresults -r "$i"
+done
+
+# Dispatch a new one
+tsresults -L WWW sh "${TSP_DIR}/jobs/update_www.sh"
+
+# Check if TAG is one of terminal states
 case "$TAG" in
     *Fail*|*Unclear*|*OK*)
         if [ -x "${TSP_DIR}/scripts/publish_hook.sh" ]
         then
+            # Link to results by SR/target
+            SRDIR="${WS_PUBLISH}/sr/$SR"
+            mkdir -p "${SRDIR}"
+            ln -sf "${IMG_WORKDIR}" "${SRDIR}/${TARGET}"
+            # Trigger the hook
             . "${TSP_DIR}/scripts/publish_hook.sh"
         fi
         ;;
@@ -207,14 +225,3 @@ case "$TAG" in
         ;;
 esac
 
-# Publish to database
-update_db "$SR" "$OVERALL_TAG" "$BUILD_NR" "$TARGET"
-
-# Remove all queued WWW jobs
-for i in $(tsresults | grep "queued.*WWW" | grep -o "^[0-9]*")
-do
-    tsresults -r "$i"
-done
-
-# Dispatch a new one
-tsresults -L WWW sh "${TSP_DIR}/jobs/update_www.sh"