Update CircleCI workflow

This commit is contained in:
2019-01-09 16:19:09 +00:00
parent 59e35280b6
commit af55b90f0d
2 changed files with 65 additions and 15 deletions

View File

@@ -1,15 +1,13 @@
#!/usr/bin/env bash
# Ensure target is defined
[ -z "$CIRCLE_BRANCH" ] && { echo >&2 "Error: Build target not defined. Aborting."; exit 1; }
[ -z "$1" ] && { echo >&2 "Error: Build target not defined. Aborting."; exit 1; }
# Test rsync is installed and ENV variables are set
hash rsync 2>/dev/null || { echo >&2 "Error: rsync is not installed. Aborting."; exit 1; }
[ -z "$SSH_IP" ] && { echo >&2 "Error: SSH_IP is missing. Aborting."; exit 1; }
[ -z "$SSH_USER" ] && { echo >&2 "Error: SSH_USER is missing. Aborting."; exit 1; }
echo "Deploying to $CIRCLE_BRANCH"
# Deploy theme with rsync
rsync -e "ssh -o StrictHostKeyChecking=no" -avzuh --progress \
theme/. $SSH_USER@$SSH_IP:~/windycoys_theme_$CIRCLE_BRANCH
theme/. $SSH_USER@$SSH_IP:~/windycoys_theme_$1