Preserve portal data during repository cutover
This commit is contained in:
@@ -32,8 +32,11 @@ jobs:
|
||||
ssh -i ~/.ssh/id_ed25519 -o StrictHostKeyChecking=yes "${DEPLOY_USER}@${DEPLOY_HOST}" "
|
||||
set -Eeuo pipefail
|
||||
mkdir -p '$TARGET_DIR'
|
||||
if [ ! -d '$TARGET_DIR/.git' ]; then git clone --branch '$BRANCH' --single-branch '$REPO_URL' '$TARGET_DIR'; else cd '$TARGET_DIR' && git remote set-url origin '$REPO_URL' && GIT_SSH_COMMAND='ssh -p 222 -o StrictHostKeyChecking=no' git fetch origin '$BRANCH' && git reset --hard 'origin/$BRANCH' && git clean -fdx; fi
|
||||
if [ ! -d '$TARGET_DIR/.git' ]; then git init '$TARGET_DIR' && cd '$TARGET_DIR' && git remote add origin '$REPO_URL'; else cd '$TARGET_DIR' && git remote set-url origin '$REPO_URL'; fi
|
||||
cd '$TARGET_DIR'
|
||||
GIT_SSH_COMMAND='ssh -p 222 -o StrictHostKeyChecking=no' git fetch origin '$BRANCH'
|
||||
git reset --hard 'origin/$BRANCH'
|
||||
git clean -fdx -e data/ -e data/**
|
||||
docker ps -q --filter publish=$PORT | xargs -r docker rm -f
|
||||
docker compose -p '$PROJECT' -f docker-compose.yml -f '$COMPOSE_FILE' down --remove-orphans || true
|
||||
docker compose -p '$PROJECT' -f docker-compose.yml -f '$COMPOSE_FILE' up -d --build
|
||||
|
||||
Reference in New Issue
Block a user