-
Notifications
You must be signed in to change notification settings - Fork 315
/
Copy pathpush_code.sh
executable file
·62 lines (50 loc) · 1.45 KB
/
push_code.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
__dir="$(dirname "$0")"
source $__dir/config.sh
# Pushes all web sources to remote machine
# DBG+=" --dry-run" # testing
FLAGS+=$DBG
FLAGS+=" -avr"
FLAGS+=" --delete"
excludes+="--exclude=anyplace_views "
excludes+="--exclude=app.private*.conf "
excludes+="--exclude=logs "
excludes+="--exclude=dist "
excludes+="--exclude=tmp "
excludes+="--exclude=public/anyplace_architect/build/ "
excludes+="--exclude=public/anyplace_viewer_campus/build/ "
excludes+="--exclude=public/anyplace_viewer/build/ "
excludes+="--exclude=.env "
excludes+="--exclude=.DS_Store "
excludes+="--exclude=\".git*\" "
excludes+="--exclude=.idea "
excludes+="--exclude=node_modules "
excludes+="--exclude=bower_components "
# Generated play files
excludes+="--exclude=target "
excludes+="--exclude=test " # scala testing
lfolders="$LFOLDER"
function pushCode() {
rfolder=$1
echo "Syncing code to: '$rfolder':"
output=$(rsync $FLAGS $LFOLDER $REMOTE:$rfolder $excludes)
if [[ $DBG != "" ]]; then
echo ""
echo "DRY RUN:"
echo rsync $FLAGS $LFOLDER $REMOTE:$rfolder $excludes
echo "FULL OUTPUT:"
echo -e $output
else
echo -e $output
fi
output=$(echo "$output" | egrep -v "building file")
output=$(echo "$output" | egrep -v "sent")
output=$(echo "$output" | egrep -v "total")
if [[ $NOTIFIER != "" ]]; then
$NOTIFIER -title "Synced" -message "$output"
fi
}
pushCode $RFOLDER
if [[ $RFOLDER2 != "" ]]; then
pushCode $RFOLDER2
fi