Created
April 2, 2021 14:43
-
-
Save mattbloomfield/271112ae2de1dcdb5585e5fd14d55f94 to your computer and use it in GitHub Desktop.
Custom `push` command to sync your local files to 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 | |
## Custom `pull` command to sync your local files with a remote env. | |
## Usage: fin sync_files | |
echo "${BLUE}Please choose an environment to push to${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 | |
SSH_URL=$(fin platform ssh --pipe --project xxxxxx -e $REMOTE_ENV) | |
rsync -av ./web/uploads/* ${SSH_URL}:web/uploads/ | |
rsync -av ./web/cpresources/* ${SSH_URL}:web/cpresources/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment