Skip to content

Commit

Permalink
[improvement](script)Audit build script (apache#11411)
Browse files Browse the repository at this point in the history
  • Loading branch information
hf200012 authored Aug 2, 2022
1 parent f730a04 commit ac62c95
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
17 changes: 17 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Usage: $0 <options>
--be build Backend
--meta-tool build Backend meta tool
--broker build Broker
--audit build audit loader
--spark-dpp build Spark DPP application
--hive-udf build Hive UDF library for Spark Load
--java-udf build Java UDF library
Expand Down Expand Up @@ -103,6 +104,7 @@ OPTS=$(getopt \
-l 'fe' \
-l 'be' \
-l 'broker' \
-l 'audit' \
-l 'meta-tool' \
-l 'spark-dpp' \
-l 'java-udf' \
Expand All @@ -122,6 +124,7 @@ PARALLEL=$[$(nproc)/4+1]
BUILD_FE=0
BUILD_BE=0
BUILD_BROKER=0
BUILD_AUDIT=0
BUILD_META_TOOL=OFF
BUILD_SPARK_DPP=0
BUILD_JAVA_UDF=0
Expand All @@ -135,6 +138,7 @@ if [ $# == 1 ] ; then
BUILD_FE=1
BUILD_BE=1
BUILD_BROKER=1
BUILD_AUDIT=1
BUILD_META_TOOL=OFF
BUILD_SPARK_DPP=1
BUILD_JAVA_UDF=0 # TODO: open it when ready
Expand All @@ -146,6 +150,7 @@ else
--fe) BUILD_FE=1 BUILD_SPARK_DPP=1 ; shift ;;
--be) BUILD_BE=1 ; shift ;;
--broker) BUILD_BROKER=1 ; shift ;;
--audit) BUILD_AUDIT=1 ; shift ;;
--meta-tool) BUILD_META_TOOL=ON ; shift ;;
--spark-dpp) BUILD_SPARK_DPP=1 ; shift ;;
--java-udf) BUILD_JAVA_UDF=1 BUILD_FE=1 BUILD_SPARK_DPP=1 ; shift ;;
Expand All @@ -163,6 +168,7 @@ else
BUILD_FE=1
BUILD_BE=1
BUILD_BROKER=1
BUILD_AUDIT=1
BUILD_META_TOOL=ON
BUILD_SPARK_DPP=1
BUILD_HIVE_UDF=1
Expand Down Expand Up @@ -225,6 +231,7 @@ echo "Get params:
BUILD_FE -- $BUILD_FE
BUILD_BE -- $BUILD_BE
BUILD_BROKER -- $BUILD_BROKER
BUILD_AUDIT -- $BUILD_AUDIT
BUILD_META_TOOL -- $BUILD_META_TOOL
BUILD_SPARK_DPP -- $BUILD_SPARK_DPP
BUILD_JAVA_UDF -- $BUILD_JAVA_UDF
Expand Down Expand Up @@ -437,6 +444,16 @@ if [ ${BUILD_BROKER} -eq 1 ]; then
cd ${DORIS_HOME}
fi

if [ ${BUILD_AUDIT} -eq 1 ]; then
install -d ${DORIS_OUTPUT}/audit_loader

cd ${DORIS_HOME}/fe_plugins/auditloader/
./build.sh
rm -rf ${DORIS_OUTPUT}/audit_loader/*
cp -r -p ${DORIS_HOME}/fe_plugins/auditloader/output/* ${DORIS_OUTPUT}/audit_loader/
cd ${DORIS_HOME}
fi

echo "***************************************"
echo "Successfully build Doris"
echo "***************************************"
Expand Down
40 changes: 40 additions & 0 deletions fe_plugins/auditloader/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/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 -e

ROOT=`dirname "$0"`
ROOT=`cd "$ROOT"; pwd`

export DORIS_HOME=${ROOT}/../..

. ${DORIS_HOME}/env.sh

export AUDITLOADER_HOME=$ROOT


$MVN_CMD clean package -DskipTests

echo "Install auditloader..."

AUDITLOADER_OUTPUT=${AUDITLOADER_HOME}/output/
rm -rf ${AUDITLOADER_OUTPUT}
mkdir ${AUDITLOADER_OUTPUT}
cp ${AUDITLOADER_HOME}/target/auditloader.zip ${AUDITLOADER_HOME}/output/

echo "Build Auditloader Finished"

0 comments on commit ac62c95

Please sign in to comment.