deploy helper
This commit is contained in:
parent
9950201dd7
commit
6b34d08cae
3 changed files with 69 additions and 0 deletions
34
deploy.sh
Executable file
34
deploy.sh
Executable file
|
|
@ -0,0 +1,34 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Deployment script for pablohere website
|
||||
# This script syncs the public folder to a remote webserver
|
||||
|
||||
set -e # Exit on error
|
||||
|
||||
# Load deployment configuration
|
||||
if [ ! -f "deploy.config" ]; then
|
||||
echo "Error: deploy.config file not found!"
|
||||
echo "Please copy deploy.config.example to deploy.config and fill in your server details."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
source deploy.config
|
||||
|
||||
# Validate required variables
|
||||
if [ -z "$REMOTE_HOST" ] || [ -z "$REMOTE_USER" ] || [ -z "$REMOTE_PATH" ]; then
|
||||
echo "Error: Required variables not set in deploy.config"
|
||||
echo "Please ensure REMOTE_HOST, REMOTE_USER, and REMOTE_PATH are set."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Use rsync to sync files
|
||||
echo "Deploying public folder to $REMOTE_USER@$REMOTE_HOST:$REMOTE_PATH"
|
||||
rsync -avz --delete \
|
||||
--exclude='.git' \
|
||||
--exclude='.DS_Store' \
|
||||
$SSH_OPTS \
|
||||
public/ \
|
||||
$REMOTE_USER@$REMOTE_HOST:$REMOTE_PATH
|
||||
|
||||
echo "Deployment complete!"
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue