-
Notifications
You must be signed in to change notification settings - Fork 386
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add script to upload code to EC2 instance
For more rapid debugging workflow
- Loading branch information
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
if [[ -n "${OTID_DEBUG}" ]]; then | ||
set -x | ||
fi | ||
|
||
function usage() { | ||
echo -n \ | ||
"Usage: $(basename "$0") <public dns of instance> | ||
Upload Github repo to EC2 instance | ||
" | ||
} | ||
|
||
PROJECT_ROOT="$(dirname "$(dirname "$(readlink -f "${0}")")")" | ||
|
||
if [ "${BASH_SOURCE[0]}" = "${0}" ] | ||
then | ||
if [ "${1:-}" = "--help" ] | ||
then | ||
usage | ||
else | ||
EC2_HOSTNAME=$1 | ||
echo "HOSTNAME: $EC2_HOSTNAME" | ||
|
||
# Copy learned models back down to the local machine | ||
rsync -avz -e "ssh -o StrictHostKeyChecking=no" \ | ||
/vagrant/src/ \ | ||
"ubuntu@$EC2_HOSTNAME:/home/ubuntu/keras-semantic-segmentation/src" | ||
fi | ||
fi |