Commit 2d2ef6354c924930183a527b2ae5c5bebe40a97a

Thomas de Grivel 2023-02-15T12:23:31

debug status

diff --git a/bin/shpkg_ci b/bin/shpkg_ci
index 51ee946..7301038 100755
--- a/bin/shpkg_ci
+++ b/bin/shpkg_ci
@@ -21,14 +21,15 @@ log_status () {
     if [ -f "${STATUS_FILE}" ]; then
         cat "${STATUS_FILE}"
     else
-        echo "unknown"
+        #echo "unknown"
+        echo "unknown(${STATUS_FILE})"
     fi
 }
 
 log2html () {
     {
         TITLE="$(echo "$1" | ansi2html)"
-        STATUS="$(log_status)"
+        STATUS="$(log_status "$1")"
         cat <<EOF
 <!DOCTYPE html>
 <html lang="en">
@@ -87,12 +88,12 @@ main () {
         fi
         SHPKG_REPO_GIT_BRANCH="$(shpkg_git_branch "${SHPKG_REPO}")"
         SHPKG_REPO_HASH="$(shpkg_hash "${SHPKG_REPO}")"
-        verbose 2 shpkg_tag_log "${SHPKG_REPO}.ci.log"
-        verbose 2 shpkg_tag_log "${SHPKG_REPO}.ci.branch_${SHPKG_REPO_GIT_BRANCH}.log"
-        verbose 2 shpkg_tag_log "${SHPKG_REPO}.ci.commit_${SHPKG_REPO_HASH}.log"
         verbose 2 shpkg_ci_status "${SHPKG_REPO}.ci.status" running
         verbose 2 shpkg_ci_status "${SHPKG_REPO}.ci.branch_${SHPKG_REPO_GIT_BRANCH}.status" running
         verbose 2 shpkg_ci_status "${SHPKG_REPO}.ci.commit_${SHPKG_REPO_HASH}.status" running
+        verbose 2 shpkg_tag_log "${SHPKG_REPO}.ci.log"
+        verbose 2 shpkg_tag_log "${SHPKG_REPO}.ci.branch_${SHPKG_REPO_GIT_BRANCH}.log"
+        verbose 2 shpkg_tag_log "${SHPKG_REPO}.ci.commit_${SHPKG_REPO_HASH}.log"
         SHPKG_REPO_BUILD_DIR="${SHPKG_CI_BUILD_DIR}/${SHPKG_REPO}"
         if ! [ -d "${SHPKG_REPO_BUILD_DIR}" ]; then
             # first bootstrap
@@ -126,15 +127,16 @@ main () {
               verbose 2 shpkg_ci_status "${SHPKG_REPO}.ci.commit_${SHPKG_REPO_HASH}.status" ko
               verbose 2 shpkg_ci_status "shpkg_ci.status" ko
           fi; )
+        verbose 2 shpkg_ci_status "${SHPKG_REPO}.ci.status" ok
+        verbose 2 shpkg_ci_status "${SHPKG_REPO}.ci.branch_${SHPKG_REPO_GIT_BRANCH}.status" ok
+        verbose 2 shpkg_ci_status "${SHPKG_REPO}.ci.commit_${SHPKG_REPO_HASH}.status" ok
         if verbose 1 cp -p "${SHPKG_REPO_BUILD_DIR}/var/log/shpkg/tags/${SHPKG_REPO}".*.log "${SHPKG_CI_LOG_DIR}" ||
            verbose 1 cp -p "${SHPKG_DIR}/var/log/shpkg/tags/${SHPKG_REPO}.ci.log" "${SHPKG_CI_LOG_DIR}"; then
             verbose 2 logs2html
         fi
-        verbose 2 shpkg_ci_status "${SHPKG_REPO}.ci.status" ok
-        verbose 2 shpkg_ci_status "${SHPKG_REPO}.ci.branch_${SHPKG_REPO_GIT_BRANCH}.status" ok
-        verbose 2 shpkg_ci_status "${SHPKG_REPO}.ci.commit_${SHPKG_REPO_HASH}.status" ok
     done
     verbose 2 shpkg_ci_status "shpkg_ci.status" ok
+    verbose 2 logs2html
 }
 
 if [ "x$1" = "x--clean" ]; then