-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild_rkdev.sh
49 lines (44 loc) · 1.9 KB
/
build_rkdev.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
#!/usr/bin/env bash
#echo ">>> git pull"
#git pull
# Skip resolving dependency of PUPPETEER
export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1
# OP or SAAS
readonly BUILD_PLATFORM_VERSION="SAAS"
readonly BUILD_CLIENT_ID="hzero-front-rkdev"
readonly BUILD_API_HOST="http://mesdev.raycus.com:8080"
readonly BUILD_BPM_HOST="http://mesdev.raycus.com:8220"
readonly BUILD_WEBSOCKET_HOST="ws://mesdev.raycus.com:8080/hpfm/websocket"
# Fix error "computed integrity doesn't match our records ..."
#rm -f yarn.lock
#yarn --registry http://mobile-app.hand-china.com/nexus/content/groups/hippius-ui-group/
#yarn --registry http://nexus.saas.hand-china.com/content/groups/hzero-npm-group/
# lerna run transpile
# yarn build:dll
# yarn build
if [[ -d "dist" ]]; then
echo "Substituting placeholders ..."
case $(uname -s) in
Linux | MINGW*)
find dist -name '*.js' | xargs sed -i "s BUILD_PLATFORM_VERSION $BUILD_PLATFORM_VERSION g"
find dist -name '*.js' | xargs sed -i "s BUILD_API_HOST $BUILD_API_HOST g"
find dist -name '*.js' | xargs sed -i "s BUILD_CLIENT_ID $BUILD_CLIENT_ID g"
find dist -name '*.js' | xargs sed -i "s BUILD_BPM_HOST $BUILD_BPM_HOST g"
find dist -name '*.js' | xargs sed -i "s BUILD_WEBSOCKET_HOST $BUILD_WEBSOCKET_HOST g"
;;
Darwin)
find dist -name '*.js' | xargs sed -i' ' "s BUILD_PLATFORM_VERSION $BUILD_PLATFORM_VERSION g"
find dist -name '*.js' | xargs sed -i' ' "s BUILD_API_HOST $BUILD_API_HOST g"
find dist -name '*.js' | xargs sed -i' ' "s BUILD_CLIENT_ID $BUILD_CLIENT_ID g"
find dist -name '*.js' | xargs sed -i' ' "s BUILD_BPM_HOST $BUILD_BPM_HOST g"
find dist -name '*.js' | xargs sed -i' ' "s BUILD_WEBSOCKET_HOST $BUILD_WEBSOCKET_HOST g"
;;
*)
echo "Unsupported platform!"
exit 1
;;
esac
fi
rm -rf html
mv dist html
echo ">>>>>>>>>>>>>>>>> bulid success <<<<<<<<<<<<<<<<<<<<"