Skip to content

Commit ac62c95

Browse files
authored
[improvement](script)Audit build script (#11411)
1 parent f730a04 commit ac62c95

2 files changed

Lines changed: 57 additions & 0 deletions

File tree

build.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ Usage: $0 <options>
4444
--be build Backend
4545
--meta-tool build Backend meta tool
4646
--broker build Broker
47+
--audit build audit loader
4748
--spark-dpp build Spark DPP application
4849
--hive-udf build Hive UDF library for Spark Load
4950
--java-udf build Java UDF library
@@ -103,6 +104,7 @@ OPTS=$(getopt \
103104
-l 'fe' \
104105
-l 'be' \
105106
-l 'broker' \
107+
-l 'audit' \
106108
-l 'meta-tool' \
107109
-l 'spark-dpp' \
108110
-l 'java-udf' \
@@ -122,6 +124,7 @@ PARALLEL=$[$(nproc)/4+1]
122124
BUILD_FE=0
123125
BUILD_BE=0
124126
BUILD_BROKER=0
127+
BUILD_AUDIT=0
125128
BUILD_META_TOOL=OFF
126129
BUILD_SPARK_DPP=0
127130
BUILD_JAVA_UDF=0
@@ -135,6 +138,7 @@ if [ $# == 1 ] ; then
135138
BUILD_FE=1
136139
BUILD_BE=1
137140
BUILD_BROKER=1
141+
BUILD_AUDIT=1
138142
BUILD_META_TOOL=OFF
139143
BUILD_SPARK_DPP=1
140144
BUILD_JAVA_UDF=0 # TODO: open it when ready
@@ -146,6 +150,7 @@ else
146150
--fe) BUILD_FE=1 BUILD_SPARK_DPP=1 ; shift ;;
147151
--be) BUILD_BE=1 ; shift ;;
148152
--broker) BUILD_BROKER=1 ; shift ;;
153+
--audit) BUILD_AUDIT=1 ; shift ;;
149154
--meta-tool) BUILD_META_TOOL=ON ; shift ;;
150155
--spark-dpp) BUILD_SPARK_DPP=1 ; shift ;;
151156
--java-udf) BUILD_JAVA_UDF=1 BUILD_FE=1 BUILD_SPARK_DPP=1 ; shift ;;
@@ -163,6 +168,7 @@ else
163168
BUILD_FE=1
164169
BUILD_BE=1
165170
BUILD_BROKER=1
171+
BUILD_AUDIT=1
166172
BUILD_META_TOOL=ON
167173
BUILD_SPARK_DPP=1
168174
BUILD_HIVE_UDF=1
@@ -225,6 +231,7 @@ echo "Get params:
225231
BUILD_FE -- $BUILD_FE
226232
BUILD_BE -- $BUILD_BE
227233
BUILD_BROKER -- $BUILD_BROKER
234+
BUILD_AUDIT -- $BUILD_AUDIT
228235
BUILD_META_TOOL -- $BUILD_META_TOOL
229236
BUILD_SPARK_DPP -- $BUILD_SPARK_DPP
230237
BUILD_JAVA_UDF -- $BUILD_JAVA_UDF
@@ -437,6 +444,16 @@ if [ ${BUILD_BROKER} -eq 1 ]; then
437444
cd ${DORIS_HOME}
438445
fi
439446

447+
if [ ${BUILD_AUDIT} -eq 1 ]; then
448+
install -d ${DORIS_OUTPUT}/audit_loader
449+
450+
cd ${DORIS_HOME}/fe_plugins/auditloader/
451+
./build.sh
452+
rm -rf ${DORIS_OUTPUT}/audit_loader/*
453+
cp -r -p ${DORIS_HOME}/fe_plugins/auditloader/output/* ${DORIS_OUTPUT}/audit_loader/
454+
cd ${DORIS_HOME}
455+
fi
456+
440457
echo "***************************************"
441458
echo "Successfully build Doris"
442459
echo "***************************************"

fe_plugins/auditloader/build.sh

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/usr/bin/env bash
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
19+
set -e
20+
21+
ROOT=`dirname "$0"`
22+
ROOT=`cd "$ROOT"; pwd`
23+
24+
export DORIS_HOME=${ROOT}/../..
25+
26+
. ${DORIS_HOME}/env.sh
27+
28+
export AUDITLOADER_HOME=$ROOT
29+
30+
31+
$MVN_CMD clean package -DskipTests
32+
33+
echo "Install auditloader..."
34+
35+
AUDITLOADER_OUTPUT=${AUDITLOADER_HOME}/output/
36+
rm -rf ${AUDITLOADER_OUTPUT}
37+
mkdir ${AUDITLOADER_OUTPUT}
38+
cp ${AUDITLOADER_HOME}/target/auditloader.zip ${AUDITLOADER_HOME}/output/
39+
40+
echo "Build Auditloader Finished"

0 commit comments

Comments
 (0)