Protect subdirectories during deploy
This commit is contained in:
15
deploy.sh
15
deploy.sh
@@ -4,6 +4,9 @@ set -e
|
||||
SRC_DIR="./"
|
||||
DEST_DIR_TEST="/var/www/staging.seanstarkey.dev/public"
|
||||
DEST_DIR_PROD="/var/www/seanstarkey.dev/public"
|
||||
PROTECTED_DIRS=(
|
||||
"Hallowdeep"
|
||||
)
|
||||
|
||||
usage() {
|
||||
echo "Usage: $0 [test|prod]"
|
||||
@@ -32,6 +35,16 @@ echo "Deploying from '$SRC_DIR' to '$DEST_DIR'..."
|
||||
|
||||
#mkdir -p "$DEST_DIR"
|
||||
|
||||
sudo rsync -av --delete --exclude .git --exclude deploy.sh --exclude '.*.swp' "$SRC_DIR" "$DEST_DIR"
|
||||
RSYNC_EXCLUDES=(
|
||||
--exclude .git
|
||||
--exclude deploy.sh
|
||||
--exclude '.*.swp'
|
||||
)
|
||||
|
||||
for dir in "${PROTECTED_DIRS[@]}"; do
|
||||
RSYNC_EXCLUDES+=(--exclude "$dir/")
|
||||
done
|
||||
|
||||
sudo rsync -av --delete "${RSYNC_EXCLUDES[@]}" "$SRC_DIR" "$DEST_DIR"
|
||||
|
||||
echo "Deployment complete."
|
||||
|
||||
Reference in New Issue
Block a user