-
Notifications
You must be signed in to change notification settings - Fork 32
/
upgrade.sh
executable file
·117 lines (91 loc) · 3.93 KB
/
upgrade.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
aiur() { arg="$( cut -d ' ' -f 2- <<< "$@" )" && curl -sL https://gitlab.aiursoft.cn/aiursoft/aiurscript/-/raw/master/$1.sh | sudo bash -s $arg; }
update()
{
instance_name=$1;
if [[ $instance_name == "" ]];
then
instance_name="Aiursoft"
echo "Using instance name: $instance_name"
else
echo "Instance name is: $instance_name"
fi
branch_name=$2;
if [[ $branch_name == "" ]];
then
branch_name="master"
echo "Using branch name: $branch_name"
else
echo "branch name is: $branch_name"
fi
# Upgrade AiurUI
curl -sL https://gitlab.aiursoft.cn/aiursoft/aiurui/-/raw/master/upgrade.sh | sudo bash
infs_code="./Infrastructures"
infs_path="/opt/apps/Infrastructures"
directory_code="$infs_code/src/WebServices/Basic/Directory"
developer_code="$infs_code/src/WebServices/Basic/Developer"
observer_code="$infs_code/src/WebServices/Infrastructure/Observer"
probe_code="$infs_code/src/WebServices/Infrastructure/Probe"
stargate_code="$infs_code/src/WebServices/Infrastructure/Stargate"
warpgate_code="$infs_code/src/WebServices/Infrastructure/Warpgate"
www_code="$infs_code/src/WebServices/Business/WWW"
wiki_code="$infs_code/src/WebServices/Business/Wiki"
status_code="$infs_code/src/WebServices/Business/Status"
account_code="$infs_code/src/WebServices/Business/Account"
ee_code="$infs_code/src/WebServices/Business/EE"
directory_path="$infs_path/Directory"
developer_path="$infs_path/Developer"
observer_path="$infs_path/Observer"
probe_path="$infs_path/Probe"
stargate_path="$infs_path/Stargate"
warpgate_path="$infs_path/Warpgate"
www_path="$infs_path/WWW"
wiki_path="$infs_path/Wiki"
status_path="$infs_path/Status"
account_path="$infs_path/Account"
ee_path="$infs_path/EE"
aiur git/clone_to https://gitlab.aiursoft.cn/aiursoft/Infrastructures $infs_code $branch_name
sed -i -e "s/\"Aiursoft\"/\"$instance_name\"/g" $infs_code/src/SDK/SDK/Values.cs
systemctl stop "stargate.service"
aiur dotnet/publish $stargate_path $stargate_code/"Aiursoft.Stargate.csproj"
systemctl stop "probe.service"
aiur dotnet/publish $probe_path $probe_code/"Aiursoft.Probe.csproj"
systemctl stop "directory.service"
aiur dotnet/publish $directory_path $directory_code/"Aiursoft.Directory.csproj"
systemctl stop "warpgate.service"
aiur dotnet/publish $warpgate_path $warpgate_code/"Aiursoft.Warpgate.csproj"
systemctl stop "observer.service"
aiur dotnet/publish $observer_path $observer_code/"Aiursoft.Observer.csproj"
systemctl stop "developer.service"
aiur dotnet/publish $developer_path $developer_code/"Aiursoft.Developer.csproj"
systemctl stop "www.service"
aiur dotnet/publish $www_path $www_code/"Aiursoft.WWW.csproj"
systemctl stop "wiki.service"
aiur dotnet/publish $wiki_path $wiki_code/"Aiursoft.Wiki.csproj"
systemctl stop "account.service"
aiur dotnet/publish $account_path $account_code/"Aiursoft.Account.csproj"
systemctl stop "ee.service"
aiur dotnet/publish $ee_path $ee_code/"Aiursoft.EE.csproj"
systemctl stop "status.service"
aiur dotnet/publish $status_path $status_code/"Aiursoft.Status.csproj"
echo "Starting infrastructurs..."
systemctl restart "probe.service"
systemctl restart "stargate.service"
systemctl restart "warpgate.service"
systemctl restart "observer.service"
sleep 30
echo "Starting basic services..."
systemctl restart "directory.service"
systemctl restart "developer.service"
sleep 30
echo "Starting business services..."
systemctl restart "www.service"
systemctl restart "account.service"
systemctl restart "ee.service"
systemctl restart "wiki.service"
sleep 30
echo "Starting monitoring services..."
systemctl restart "status.service"
systemctl restart "ee.service"
rm $infs_code -rf
}
update "$@"