Created
April 2, 2021 15:12
-
-
Save mattbloomfield/95cd9e65382f98a9412d93b81df0b318 to your computer and use it in GitHub Desktop.
Custom `pull` command to sync your local files with a remote env.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
BLUE=\\x1B[34m | |
YELLOW=\\x1B[33m | |
GREEN=\\x1B[32m | |
RED=\\x1B[31m | |
RESET=\\x1b[0m | |
REMOTE_ENV=$1 | |
## Custom `pull` command to sync your local files with a remote env. | |
## Usage: fin sync_files <environment> | |
if [ -z "$REMOTE_ENV" ] | |
then | |
echo "${BLUE}Please choose an environment to pull from${RESET}" | |
select REMOTE_ENV in "master" "staging" "production"; do | |
case $REMOTE_ENV in | |
"master") | |
break | |
;; | |
"staging") | |
break | |
;; | |
"production") | |
break | |
;; | |
*) | |
echo "Invalid option $REPLY";; | |
esac | |
done | |
fi | |
SSH_URL=$(fin platform ssh --pipe --project xxxxx -e $REMOTE_ENV) | |
rsync -av ${SSH_URL}:web/uploads/* ./web/uploads/ | |
rsync -av ${SSH_URL}:web/cpresources/* ./web/cpresources/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment