Last active
March 25, 2018 20:36
-
-
Save matttrent/feeab97d476f8dde7c0f713ef03c6f0a to your computer and use it in GitHub Desktop.
remote put/get scripts
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/bash | |
# syncs the default EC2 instance to current project (as defined by git repo) | |
# get the path to the project root (where the .git folder is) | |
project_path=`git rev-parse --show-toplevel 2> /dev/null` | |
if [ $? -eq 0 ]; then | |
# name of the project folder | |
project_name=`basename $project_path` | |
# rsync from server ~/projects/project-name | |
rsync -avL --cvs-exclude --progress \ | |
# ignore the push-only folders | |
--exclude=/code --exclude=/scripts --exclude=/docs \ | |
-e "ssh" $1 \ | |
$REMOTE_INSTANCE_URL:projects/$project_name/ $project_path | |
fi |
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/bash | |
# syncs the current project (as defined by git repo) to default EC2 instance | |
# get the path to the project root (where the .git folder is) | |
project_path=`git rev-parse --show-toplevel 2> /dev/null` | |
if [ $? -eq 0 ]; then | |
# name of the project folder | |
project_name=`basename $project_path` | |
# rsync to server ~/projects/project-name | |
rsync -avL --progress \ | |
# ignore the pull-only folders | |
--exclude=/notebooks --exclude=/results \ | |
-e "ssh" $1 \ | |
$project_path $REMOTE_INSTANCE_URL:projects | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment