-
Notifications
You must be signed in to change notification settings - Fork 80
/
build.sh
77 lines (64 loc) · 2.46 KB
/
build.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
#!/usr/bin/env bash
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
set -eo pipefail
curdir=`dirname "$0"`
curdir=`cd "$curdir"; pwd`
export BUILD_HOME=`cd "$curdir"; pwd`
echo "$BUILD_HOME"
echo "build doris manager home path"
echo "build doris manager frontend start"
cd frontend
npm config set legacy-peer-deps true
npm install
npm run build
echo "build doris manager frontend end"
cd ../
echo "copy doris manager web resources to server"
echo "Check whether the front end is compiled successfully"
export FRONTEND_DIR="$BUILD_HOME/frontend/dist"
if [ ! -d $FRONTEND_DIR ]; then
echo "Error: Front end compilation failed, please check the compilation log."
exit 1
fi
echo "The front end is compiled successfully"
rm -rf manager/manager-server/src/main/resources/web-resource
mv frontend/dist manager/manager-server/src/main/resources/web-resource
echo "copy doris manager web resources to server end"
echo "build doris manager server start"
rm -rf output
rm -rf doris-manager-1.0.0.tar.gz
mkdir -p output
mkdir -p output/server/lib
cd manager
set -e
mvn clean install
echo "build doris manager server end"
echo "copy to output package start"
cd ../
mv manager/manager-server/target/manager-server-1.0.0.jar output/server/lib/doris-manager.jar
cp -r manager/conf output/server/
cp -r manager/manager-bin output/
mv output/manager-bin/agent output/
mv output/manager-bin output/server/bin
mkdir -p output/agent/lib
mv manager/dm-agent/target/dm-agent-1.0.0.jar output/agent/lib/dm-agent.jar
mkdir -p output/agent/config
cp manager/dm-agent/src/main/resources/application.properties output/agent/config
cp -r manager/manager-server/src/main/resources/web-resource output/server/
tar -zcvf doris-manager-1.0.0.tar.gz output/
echo "copy to output package end"