-
Notifications
You must be signed in to change notification settings - Fork 3.4k
/
update.sh
67 lines (58 loc) · 1.65 KB
/
update.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
#!/usr/bin/bash
cat << "EOF"
Usage:
./update.sh dev --> Upgrade to the latest development version
./update.sh release $release_version $db_version --> Upgrade to the release version with the specified database version
./update.sh release-nogit --> Upgrade to the current release version without git(You will need to manually download the latest release version)
EOF
do_update_sspanel_dev(){
git pull origin dev
git reset --hard origin/dev
git fetch --prune --prune-tags
rm -r storage/framework/smarty/compile/*
php composer.phar install --no-dev
php composer.phar selfupdate
php xcat Update
php xcat Tool importSetting
php xcat Migration latest
}
do_update_sspanel_release(){
tag=$1
db_version=$2
git pull --tags
git reset --hard $tag
rm -r storage/framework/smarty/compile/*
php composer.phar install --no-dev
php composer.phar selfupdate
php xcat Update
php xcat Tool importSetting
php xcat Migration $db_version
}
do_update_sspanel_release_nogit(){
rm -r storage/framework/smarty/compile/*
php composer.phar install --no-dev
php composer.phar selfupdate
php xcat Update
php xcat Tool importSetting
php xcat Migration latest
}
if [[ $1 == "dev" ]]; then
do_update_sspanel_dev
exit 0
fi
if [[ $1 == "release" ]]; then
if [[ $2 == "" ]]; then
echo "Error: The release version cannot be empty!"
exit 1
fi
if [[ $3 == "" ]]; then
echo "Error: The database version cannot be empty!"
exit 1
fi
do_update_sspanel_release $2 $3
exit 0
fi
if [[ $1 == "release-nogit" ]]; then
do_update_sspanel_release_nogit
exit 0
fi