Skip to content

Instantly share code, notes, and snippets.

@mattbloomfield
Created April 2, 2021 14:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattbloomfield/271112ae2de1dcdb5585e5fd14d55f94 to your computer and use it in GitHub Desktop.
Save mattbloomfield/271112ae2de1dcdb5585e5fd14d55f94 to your computer and use it in GitHub Desktop.
Custom `push` command to sync your local files to a remote env.
#!/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