Use sudo fallback for local source deploy
This commit is contained in:
+12
-5
@@ -224,12 +224,19 @@ deploy-production-source:
|
||||
docker compose -f docker-compose.server.yml up -d --build && \
|
||||
docker compose -f docker-compose.asterisk.server.yml up -d --build"
|
||||
else
|
||||
mkdir -p "$DEPLOY_TARGET_PATH"
|
||||
rsync -av --exclude '.git/' --exclude '.tmp/' --exclude '.codex_tmp/' --exclude '.local_stack/' --exclude '.data_pg/' ./ "$DEPLOY_TARGET_PATH/"
|
||||
mkdir -p "$DEPLOY_TARGET_PATH/.data_local/generated_ivr_yandex/ivr" "$DEPLOY_TARGET_PATH/.data_local/recordings" "$DEPLOY_TARGET_PATH/.asterisk_assets"
|
||||
run_local() {
|
||||
if command -v sudo >/dev/null 2>&1 && sudo -n true >/dev/null 2>&1; then
|
||||
sudo -n "$@"
|
||||
else
|
||||
"$@"
|
||||
fi
|
||||
}
|
||||
run_local mkdir -p "$DEPLOY_TARGET_PATH"
|
||||
run_local rsync -av --exclude '.git/' --exclude '.tmp/' --exclude '.codex_tmp/' --exclude '.local_stack/' --exclude '.data_pg/' ./ "$DEPLOY_TARGET_PATH/"
|
||||
run_local mkdir -p "$DEPLOY_TARGET_PATH/.data_local/generated_ivr_yandex/ivr" "$DEPLOY_TARGET_PATH/.data_local/recordings" "$DEPLOY_TARGET_PATH/.asterisk_assets"
|
||||
cd "$DEPLOY_TARGET_PATH/deployment"
|
||||
docker compose -f docker-compose.server.yml up -d --build
|
||||
docker compose -f docker-compose.asterisk.server.yml up -d --build
|
||||
run_local docker compose -f docker-compose.server.yml up -d --build
|
||||
run_local docker compose -f docker-compose.asterisk.server.yml up -d --build
|
||||
fi
|
||||
rules:
|
||||
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
|
||||
|
||||
Reference in New Issue
Block a user