forked from robotoworks/mechanoid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.sh
57 lines (45 loc) · 1.22 KB
/
deploy.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
#!/bin/bash
source ../deploy-mechanoid-settings.sh
REMOTE_SNAPSHOT_PATH=$REMOTE_PATH/mechanoid/updates/snapshot
REMOTE_DOC_PATH=$REMOTE_PATH/mechanoid/doc
clear
deployUpdateSite() {
echo "Deploying Update Site..."
ssh $REMOTE_USER "rm -r $REMOTE_SNAPSHOT_PATH"
ssh $REMOTE_USER "mkdir $REMOTE_SNAPSHOT_PATH"
scp -r $PWD/target/ide/eclipse/** $REMOTE_USER:$REMOTE_SNAPSHOT_PATH
scp $PWD/target/lib/mechanoid.jar $REMOTE_USER:$REMOTE_SNAPSHOT_PATH/mechanoid.jar
scp $PWD/target/lib/mechanoid-sources.jar $REMOTE_USER:$REMOTE_SNAPSHOT_PATH/mechanoid-sources.jar
}
deployDoc() {
echo "Deploying Docs..."
ssh $REMOTE_USER "rm -r $REMOTE_DOC_PATH"
ssh $REMOTE_USER "mkdir -p $REMOTE_DOC_PATH"
scp -r $PWD/target/doc/** $REMOTE_USER:$REMOTE_DOC_PATH
}
deploy() {
echo "Deploy Mode: $1"
if [ "$1" == "all" ]; then
deployUpdateSite
deployDoc
exit 1
elif [ "$1" == "site" ]; then
deployUpdateSite
exit 1
elif [ "$1" == "doc" ]; then
deployDoc
exit 1
else
echo "Invalid Deploy Option: $1"
exit 0
fi
}
usage() {
echo "Usage:$0 (site|doc|all)"
}
if [ "$#" -eq "0" ]; then
usage
exit 1
else
deploy $1
fi