Skip to content

Commit

Permalink
Use rsync instead of scp
Browse files Browse the repository at this point in the history
  • Loading branch information
samirelanduk committed Jul 7, 2019
1 parent 6853c7d commit aacadaa
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,8 @@ host="api.zincbind.net"
# Empty the current source directory on the server
ssh $host "rm -r ~/$host/source/* >& /dev/null"

# Work out which files to send
files="`git ls-files`"

# Make server directory structure
commands=()
for f in $files; do
dir=`dirname $f`
commands+=("mkdir -p ~/$host/source/$dir;")
done
ssh $host "${commands[@]}"

# Copy files to server one by one
for f in $files; do
scp $f $host:~/$host/source/$f
done
# Send git tracked files
rsync -vr . --exclude-from='.gitignore' --exclude='.git' $host:~/$host/source

# Copy secrets
scp core/secrets.py $host:~/$host/source/core/secrets.py
Expand Down

0 comments on commit aacadaa

Please sign in to comment.