Skip to content

Commit

Permalink
Add script to upload code to EC2 instance
Browse files Browse the repository at this point in the history
For more rapid debugging workflow
  • Loading branch information
lewfish committed Feb 21, 2017
1 parent 3512706 commit 0a7c714
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions scripts/upload_code
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

0 comments on commit 0a7c714

Please sign in to comment.