-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathtravis.sh
52 lines (39 loc) · 1.26 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
echo TAG: $TRAVIS_TAG
# echo nexus_auth: ${nexus_auth}
packing(){
# cd ./demo
echo $PWD
# 如果有 build, 不再构建,直接发布
if [ -d build ]
then
echo '\nhave build\n'
else
echo '\nnot have build\n'
npm install
echo -e "\nINSTALL DONE.\n"
TRAVIS=true TAG_NAME=$TRAVIS_TAG npm run build
echo -e "\nBUILD DONE.\n"
fi
sed -i "s/{#version}/${TRAVIS_TAG}/g" ./build/index.html
echo "replace version success: ${TRAVIS_TAG}"
}
upload(){
# 为了不修改 ci,copy 一份
echo -e "\nCOPY files...\n"
cp -r ./build ./videocall-web
echo -e "\nZIP files...\n"
zip -r $TRAVIS_TAG.zip ./videocall-web
echo -e "\nZIPED files...\n"
UPLOAD_PARAMS="-v -F r=releases -F hasPom=false -F e=zip -F g=com.easemob.rtc.front.meeting -F a=meeting -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
}
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