45 lines
1.3 KiB
Bash
Executable File
45 lines
1.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
#
|
|
# deploy.sh — sincronizează site-ul romfast-website pe prod (a2hosting).
|
|
#
|
|
# Folosire:
|
|
# ./deploy.sh # deploy real
|
|
# ./deploy.sh --dry-run # arată ce s-ar transfera, fără să modifice prod
|
|
#
|
|
# Note:
|
|
# - Rsync-ul NU folosește --delete, deci nu șterge nimic pe server.
|
|
# - efactura-generator/config.json e exclus explicit (conține api_key,
|
|
# gestionat doar pe server).
|
|
# - Folderul WIP „Index redesign - romfast.ro/" e exclus ca să nu ajungă public.
|
|
|
|
set -euo pipefail
|
|
|
|
# Directorul în care se află scriptul (rădăcina repo-ului).
|
|
SRC_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/"
|
|
|
|
# Destinație prod
|
|
SSH_PORT=7822
|
|
REMOTE_USER=romfastr
|
|
REMOTE_HOST=nl1-ss18.a2hosting.com
|
|
REMOTE_PATH='~/public_html/'
|
|
|
|
DRY_RUN=()
|
|
if [[ "${1:-}" == "--dry-run" || "${1:-}" == "-n" ]]; then
|
|
DRY_RUN=(--dry-run)
|
|
echo ">>> DRY-RUN: nu se modifică nimic pe prod"
|
|
fi
|
|
|
|
rsync -avz "${DRY_RUN[@]}" \
|
|
--exclude='.git' \
|
|
--exclude='.superdesign' \
|
|
--exclude='.claude' \
|
|
--exclude='verify-cleanup.sh' \
|
|
--exclude='deploy.sh' \
|
|
--exclude='efactura-generator/config.json' \
|
|
--exclude='Index redesign - romfast.ro/' \
|
|
-e "ssh -p ${SSH_PORT}" \
|
|
"${SRC_DIR}" \
|
|
"${REMOTE_USER}@${REMOTE_HOST}:${REMOTE_PATH}"
|
|
|
|
echo ">>> Deploy finalizat."
|