Skip to content
Snippets Groups Projects
Commit 0aa0d2c3 authored by David Dorchies's avatar David Dorchies :zany_face:
Browse files

fix: correct definition of the base folder for prod and dev versions

Refs #540
parent 2be24483
No related branches found
No related tags found
No related merge requests found
Pipeline #139658 failed
...@@ -118,8 +118,7 @@ deploy-dev: ...@@ -118,8 +118,7 @@ deploy-dev:
- build - build
script: script:
# Copie de la branche / du tag # Copie de la branche / du tag
- if [[ $CI_COMMIT_REF_NAME != "stable" ]]; then ./scripts/deploy-version.sh $CI_COMMIT_REF_NAME $DEV_LOGIN $DEV_HOST $DEV_PATH; fi - ./scripts/deploy-version.sh $CI_COMMIT_REF_NAME $DEV_LOGIN $DEV_HOST $DEV_PATH
- if [[ $CI_COMMIT_REF_NAME == "stable" ]]; then ./scripts/deploy-version.sh $CI_COMMIT_REF_NAME $DEV_LOGIN $DEV_HOST $DEV_PATH/stable 0; fi
deploy-prod: deploy-prod:
stage: deploy-prod stage: deploy-prod
...@@ -129,7 +128,7 @@ deploy-prod: ...@@ -129,7 +128,7 @@ deploy-prod:
dependencies: dependencies:
- build - build
script: script:
- ./scripts/deploy-version.sh stable $PROD_LOGIN $PROD_HOST $PROD_PATH 1 $PROD_PASS - ./scripts/deploy-version.sh prod $PROD_LOGIN $PROD_HOST $PROD_PATH $PROD_PASS
releases-nightly: releases-nightly:
stage: releases-nightly stage: releases-nightly
......
...@@ -14,20 +14,16 @@ VERSION="$1" ...@@ -14,20 +14,16 @@ VERSION="$1"
LOGIN="$2" LOGIN="$2"
HOST="$3" HOST="$3"
DIR="$4" DIR="$4"
UPDATE_INDEX=$5 PASS="$5"
PASS="$6"
echo "$(basename $0): deploying version $VERSION in $LOGIN@$HOST:$DIR" echo "$(basename $0): deploying version $VERSION in $LOGIN@$HOST:$DIR"
if [[ $VERSION == "stable" ]]; then if [[ $VERSION == "prod" ]]; then
# Copie de la branche production # Copie de la branche production
rsync -a --delete --exclude=cassiopee-releases -e "ssh -o StrictHostKeyChecking=no" dist/ ${LOGIN}@${HOST}:${DIR}/ rsync -a --delete --exclude=cassiopee-releases -e "ssh -o StrictHostKeyChecking=no" dist/ ${LOGIN}@${HOST}:${DIR}/
# Modification du dossier base href
if (( $UPDATE_INDEX == 1 )); then echo "updating index.html"
# Modification du dossier base href ssh $LOGIN@$HOST "sed -i 's:/cassiopee/stable/:/:g' $DIR/index.html"
echo "updating index.html"
ssh $LOGIN@$HOST "sed -i 's:/cassiopee/stable/:/:g' $DIR/index.html"
fi
else else
# Copie de la branche / du tag # Copie de la branche / du tag
rsync -a --delete --exclude=cassiopee-releases -e "ssh -o StrictHostKeyChecking=no" "dist/" "$LOGIN@$HOST:$DIR/$VERSION" rsync -a --delete --exclude=cassiopee-releases -e "ssh -o StrictHostKeyChecking=no" "dist/" "$LOGIN@$HOST:$DIR/$VERSION"
......
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