From d855b9eaf5684d56a304b05a89050ed478836d1b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Grand?= <francois.grand@inrae.fr>
Date: Wed, 8 Feb 2023 17:25:41 +0100
Subject: [PATCH] chore: deploy-version.sh: display remote base href

refs #588
---
 scripts/deploy-version.sh | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/scripts/deploy-version.sh b/scripts/deploy-version.sh
index 4f05359f9..fe9182c92 100755
--- a/scripts/deploy-version.sh
+++ b/scripts/deploy-version.sh
@@ -15,11 +15,20 @@ LOGIN="$2"
 HOST="$3"
 DIR="$4"
 
+function display_remote_href()
+{
+  echo "base href in deployed index.html (host=$HOST) :"
+  ssh $LOGIN@$HOST "grep \<base $DIR/index.html"
+}
+
 echo "$(basename $0): deploying version $VERSION in $LOGIN@$HOST:$DIR"
 
 if [[ $VERSION == "prod" || $VERSION == "prod-devel" ]]; then
   # Copie de la branche production
   rsync -a --delete --exclude=cassiopee-releases -e "ssh -o StrictHostKeyChecking=no" dist/ ${LOGIN}@${HOST}:${DIR}/
+
+  display_remote_href
+
   # Modification du dossier base href
   echo "updating index.html"
   if [[ $VERSION == "prod" ]]; then
@@ -27,7 +36,12 @@ if [[ $VERSION == "prod" || $VERSION == "prod-devel" ]]; then
   else
     ssh $LOGIN@$HOST "sed -i 's:/cassiopee/devel/:/:g' $DIR/index.html"
   fi
+
+  display_remote_href
 else
   # Copie de la branche / du tag
   rsync -a --delete --exclude=cassiopee-releases -e "ssh -o StrictHostKeyChecking=no" "dist/" "$LOGIN@$HOST:$DIR/$VERSION"
+
+  echo "NOT updating index.html"
+  display_remote_href
 fi
-- 
GitLab