Skip to content
Snippets Groups Projects
Commit 20b3a1c3 authored by François Grand's avatar François Grand
Browse files

fix(chore): wrong base href in deployed dev versions

refs #588
parent be480b6f
No related branches found
No related tags found
2 merge requests!225Release v4.17.0,!196Resolve "Application PWA inaccessible hors ligne"
Pipeline #140167 passed
......@@ -91,7 +91,7 @@ build:
paths:
- dist/
script:
- npm run build -- --base-href=/cassiopee/$CI_COMMIT_REF_NAME/
- npm run build
clean-stale-branches:
stage: clean-stale-branches
......
......@@ -35,24 +35,23 @@ echo "$(basename $0): deploying version $VERSION in $LOGIN@$HOST:$DIR"
if [[ $VERSION == "prod" || $VERSION == "prod-devel" ]]; then
display_local_href
# Copie de la branche production
rsync -a --delete --exclude=cassiopee-releases -e "ssh -o StrictHostKeyChecking=no" dist/ ${LOGIN}@${HOST}:${DIR}/
# Modification du dossier base href -> /
echo "updating index.html base href to /"
sed -i '/<base/s/href="[^"]*"/href="\/"/' $LOCAL_DIR/index.html
# Modification du dossier base href
echo "updating index.html"
if [[ $VERSION == "prod" ]]; then
ssh $LOGIN@$HOST "sed -i 's:/cassiopee/stable/:/:g' $DIR/index.html"
else
ssh $LOGIN@$HOST "sed -i 's:/cassiopee/devel/:/:g' $DIR/index.html"
fi
# Copie de la branche production
rsync -a --delete --exclude=cassiopee-releases -e "ssh -o StrictHostKeyChecking=no" $LOCAL_DIR/ ${LOGIN}@${HOST}:${DIR}/
display_remote_href $DIR
else
echo "NOT updating index.html"
display_local_href
# Modification du dossier base href -> /cassiopee/version/
echo "updating index.html base href to /cassiopee/$VERSION/"
sed -i "/<base/s/href=\"[^\"]*\"/href=\"\/cassiopee\/$VERSION\/\"/" $LOCAL_DIR/index.html
# Copie de la branche / du tag
rsync -a --delete --exclude=cassiopee-releases -e "ssh -o StrictHostKeyChecking=no" "$LOCAL_DIR/" "$LOGIN@$HOST:$DIR/$VERSION"
rsync -a --delete --exclude=cassiopee-releases -e "ssh -o StrictHostKeyChecking=no" $LOCAL_DIR/ "$LOGIN@$HOST:$DIR/$VERSION"
display_remote_href $DIR/$VERSION
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment