17 lines
529 B
Bash
Executable file
17 lines
529 B
Bash
Executable file
#!/bin/bash
|
|
# Deploy build artifacts to production
|
|
set -euo pipefail
|
|
|
|
VERSION="${1:-latest}"
|
|
DEPLOY_USER="deploy"
|
|
DEPLOY_HOST="prod.nexus.local"
|
|
DEPLOY_PATH="/opt/app"
|
|
|
|
echo "[deploy] Starting deployment of version $VERSION..."
|
|
rsync -av --delete ./dist/ "$DEPLOY_USER@$DEPLOY_HOST:$DEPLOY_PATH/"
|
|
ssh "$DEPLOY_USER@$DEPLOY_HOST" "systemctl restart nexus-app"
|
|
echo "[deploy] Done."
|
|
|
|
# Post-deploy notification
|
|
source "$(dirname "$0")/../lib/notify.sh"
|
|
notify "Deployment of $VERSION to prod completed successfully" "#deployments"
|