forked from telegramdesktop/tdesktop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDeploy.sh
executable file
·130 lines (110 loc) · 4.26 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
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
118
119
120
121
122
123
124
125
126
127
128
129
130
set -e
while IFS='' read -r line || [[ -n "$line" ]]; do
set $line
eval $1="$2"
done < Version
AppVersionStrFull="$AppVersionStr"
DevParam=''
if [ "$DevChannel" != "0" ]; then
AppVersionStrFull="$AppVersionStr.dev"
DevParam='-dev'
fi
if [ ! -f "Target" ]; then
echo "Build target not found!"
exit 1
fi
while IFS='' read -r line || [[ -n "$line" ]]; do
BuildTarget="$line"
done < Target
echo ""
if [ "$BuildTarget" == "linux" ]; then
echo "Deploying version $AppVersionStrFull for Linux 64bit.."
UpdateFile="tlinuxupd$AppVersion"
SetupFile="tsetup.$AppVersionStrFull.tar.xz"
ReleasePath="./../Linux/Release"
RemoteFolder="tlinux"
elif [ "$BuildTarget" == "linux32" ]; then
echo "Deploying version $AppVersionStrFull for Linux 32bit.."
UpdateFile="tlinux32upd$AppVersion"
SetupFile="tsetup32.$AppVersionStrFull.tar.xz"
ReleasePath="./../Linux/Release"
RemoteFolder="tlinux32"
elif [ "$BuildTarget" == "mac" ]; then
echo "Deploying three versions of $AppVersionStrFull: for Windows, OS X 10.6 and 10.7 and OS X 10.8+.."
UpdateFile="tmacupd$AppVersion"
SetupFile="tsetup.$AppVersionStrFull.dmg"
ReleasePath="./../Mac/Release"
RemoteFolder="tmac"
Mac32DeployPath="./../../tother/tmac32/$AppVersionStrMajor/$AppVersionStrFull"
Mac32UpdateFile="tmac32upd$AppVersion"
Mac32SetupFile="tsetup32.$AppVersionStrFull.dmg"
Mac32RemoteFolder="tmac32"
WinDeployPath="./../../tother/tsetup/$AppVersionStrMajor/$AppVersionStrFull"
WinUpdateFile="tupdate$AppVersion"
WinSetupFile="tsetup.$AppVersionStrFull.exe"
WinPortableFile="tportable.$AppVersionStrFull.zip"
WinRemoteFolder="tsetup"
DropboxPath="./../../../Dropbox/Telegram/deploy/$AppVersionStrMajor"
DropboxDeployPath="$DropboxPath/$AppVersionStrFull"
elif [ "$BuildTarget" == "mac32" ] || [ "$BuildTarget" = "macstore" ]; then
echo "No need to deploy this target."
exit
else
echo "Invalid target!"
exit 1
fi
DeployPath="$ReleasePath/deploy/$AppVersionStrMajor/$AppVersionStrFull"
#if [ "$BuildTarget" == "linux" ] || [ "$BuildTarget" == "linux32" ] || [ "$BuildTarget" == "mac" ] || [ "$BuildTarget" == "mac32" ] || [ "$BuildTarget" == "macstore" ]; then
if [ ! -f "$DeployPath/$UpdateFile" ]; then
echo "$UpdateFile not found!";
exit 1
fi
if [ ! -f "$DeployPath/$SetupFile" ]; then
echo "$SetupFile not found!"
exit 1
fi
if [ "$BuildTarget" == "mac" ]; then
if [ ! -f "$Mac32DeployPath/$Mac32UpdateFile" ]; then
echo "$Mac32UpdateFile not found!"
exit 1
fi
if [ ! -f "$Mac32DeployPath/$Mac32SetupFile" ]; then
echo "$Mac32SetupFile not found!"
exit 1
fi
if [ ! -f "$WinDeployPath/$WinUpdateFile" ]; then
echo "$WinUpdateFile not found!"
exit 1
fi
if [ ! -f "$WinDeployPath/$WinSetupFile" ]; then
echo "$WinSetupFile not found!"
exit 1
fi
if [ ! -f "$WinDeployPath/$WinPortableFile" ]; then
echo "$WinPortableFile not found!"
exit 1
fi
if [ ! -d "./../../../Dropbox/Telegram/deploy/$AppVersionStrMajor" ]; then
mkdir "./../../../Dropbox/Telegram/deploy/$AppVersionStrMajor"
fi
fi
#fi
if [ "$BuildTarget" == "linux" ] || [ "$BuildTarget" == "linux32" ] || [ "$BuildTarget" == "mac" ]; then
scp "$DeployPath/$UpdateFile" "tmaster:tdesktop/www/$RemoteFolder/"
scp "$DeployPath/$SetupFile" "tmaster:tdesktop/www/$RemoteFolder/"
if [ "$BuildTarget" == "mac" ]; then
scp "$Mac32DeployPath/$Mac32UpdateFile" "tmaster:tdesktop/www/$Mac32RemoteFolder/"
scp "$Mac32DeployPath/$Mac32SetupFile" "tmaster:tdesktop/www/$Mac32RemoteFolder/"
scp "$WinDeployPath/$WinUpdateFile" "tmaster:tdesktop/www/$WinRemoteFolder/"
scp "$WinDeployPath/$WinSetupFile" "tmaster:tdesktop/www/$WinRemoteFolder/"
scp "$WinDeployPath/$WinPortableFile" "tmaster:tdesktop/www/$WinRemoteFolder/"
mv -v "$WinDeployPath" "$DropboxPath/"
cp -v "$DeployPath/$UpdateFile" "$DropboxDeployPath/"
cp -v "$DeployPath/$SetupFile" "$DropboxDeployPath/"
cp -rv "$DeployPath/Telegram.app.dSYM" "$DropboxDeployPath/"
cp -v "$Mac32DeployPath/$Mac32UpdateFile" "$DropboxDeployPath/"
cp -v "$Mac32DeployPath/$Mac32SetupFile" "$DropboxDeployPath/"
cp -rv "$DeployPath/Telegram.app.dSYM" "$DropboxDeployPath/Telegram32.app.dSYM"
fi
fi
echo "Version $AppVersionStrFull was deployed!";