forked from easemob/easemob-demo-react
-
Notifications
You must be signed in to change notification settings - Fork 0
/
travis.sh
73 lines (59 loc) · 1.8 KB
/
travis.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
echo TAG: $TRAVIS_TAG
echo nexus_auth: ${nexus_auth}
packing(){
cd ./demo
npm install
cd ../
echo -e "\nINSTALL DONE.\n"
cd ./sdk
npm link
cd ../
echo -e "\nCREATE [WEBRTC] GLOBAL LINK DONE.\n"
cd ./webrtc
npm link
cd ../
echo -e "\nCREATE [WEBRTC] GLOBAL LINK DONE.\n"
cd ./emedia
npm link
cd ../
echo -e "\nCREATE [EMEDIA] GLOBAL LINK DONE.\n"
cd ./demo
npm link easemob-websdk
cd ../
echo -e "\nLINK [WEBRTC] DONE.\n"
cd ./demo
npm link easemob-webrtc
cd ../
echo -e "\nLINK [WEBRTC] DONE.\n"
cd ./demo
npm link easemob-emedia
cd ../
echo -e "\nLINK [EMEDIA] DONE.\n"
cd ./demo
TRAVIS=true TAG_NAME=$TRAVIS_TAG npm run build
cd ../
echo -e "\nBUILD DONE.\n"
sed -i "s/{#version}/${TRAVIS_TAG}/g" ./demo/build/index.html
}
upload(){
# 为了不修改 ci,copy 一份
echo -e "\nCOPY files...\n"
cp -r ./demo/build ./chatdemo-webim
echo -e "\nZIP files...\n"
zip -r $TRAVIS_TAG.zip chatdemo-webim
UPLOAD_PARAMS="-v -F r=releases -F hasPom=false -F e=zip -F g=com.easemob.chatdemo2 -F a=webim -F v="$TRAVIS_TAG" -F p=zip -F file=@"$TRAVIS_TAG".zip -u ci-deploy:Xyc-R5c-SdS-2Qr "
UPLOAD_URL="https://hk.nexus.op.easemob.com/nexus/service/local/artifact/maven/content"
echo -e "\nUPLOAD ZIP..."
echo -e $UPLOAD_PARAMS"\n"$UPLOAD_URL"\n"
curl $UPLOAD_PARAMS $UPLOAD_URL
# curl
# -v -F r=releases -F hasPom=false -F e=zip -F g=com.easemob.im.fe.rs -F a=im-console -F v=$TRAVIS_TAG -F p=zip -F [email protected] -u ci-deploy:Xyc-R5c-SdS-2Qr
# http://hk.nexus.op.easemob.com/nexus/service/local/artifact/maven/content
}
if [ $TRAVIS_TAG ]; then
echo -e "\n[is a tag] start packing\n"
packing || exit 1
upload
else
echo -e "\n[not a tag] exit packing\n"
fi