Skip to content
Permalink
Browse files
[chore] modify some script for building connector (#7)
  • Loading branch information
morningman committed Mar 1, 2022
1 parent dffb307 commit d2e3f7e71f6807d91f83e052c91052aefab763fb
Showing 7 changed files with 108 additions and 23 deletions.
@@ -0,0 +1,41 @@
#
# 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.
#

github:
description: Spark Connector for Apache Doris(incubating)
homepage: https://doris.apache.org/
labels:
- data-warehousing
- mpp
- olap
- dbms
- apache
- doris
- spark
enabled_merge_buttons:
squash: true
merge: false
rebase: false
protected_branches:
master:
required_pull_request_reviews:
dismiss_stale_reviews: true
required_approving_review_count: 1
notifications:
issues: commits@doris.apache.org
commits: commits@doris.apache.org
pullrequests: commits@doris.apache.org
@@ -48,9 +48,9 @@ jobs:
- name: Build spark connector v2
run: |
cd spark-doris-connector/ && /bin/bash build.sh 2.3.4 2.11
cd spark-doris-connector/ && /bin/bash build.sh --spark 2.3.4 --scala 2.11
- name: Build spark connector v3
run: |
cd spark-doris-connector/ && /bin/bash build.sh 3.1.2 2.12
cd spark-doris-connector/ && /bin/bash build.sh --spark 3.1.2 --scala 2.12
@@ -17,8 +17,8 @@ specific language governing permissions and limitations
under the License.
-->

# Contribute to Doris
# Contribute to Doris and its surrounding projects

Thank you very much for your interest in the Doris project. We welcome your suggestions, comments (including criticisms), comments and contributions to the Doris project.
Thank you very much for your interest in the Doris and its surrounding projects. We welcome your suggestions, comments (including criticisms), comments and contributions to the Doris.

For more information on how to contribute to Doris, please go to the Doris main repository [CONTRIBUTING](https://github.com/apache/incubator-doris/blob/master/CONTRIBUTING.md)
@@ -17,8 +17,9 @@ specific language governing permissions and limitations
under the License.
-->

# 为 Doris 做贡献

非常感谢您对 Doris 项目感兴趣,我们非常欢迎您对 Doris 项目的各种建议、意见(包括批评)、评论和贡献。
# Doris 及其周边项目做贡献

关于如何为 Doris 做贡献,请前往 Doris 主库查阅 [CONTRIBUTING_CN](https://github.com/apache/incubator-doris/blob/master/CONTRIBUTING_CN.md)
非常感谢您对 Doris 及其周边项目感兴趣,我们非常欢迎您对 Doris 的各种建议、意见(包括批评)、评论和贡献。

关于如何为 Doris 及周边项目做贡献,请前往 Doris 主库查阅 [CONTRIBUTING_CN](https://github.com/apache/incubator-doris/blob/master/CONTRIBUTING_CN.md)
@@ -1,4 +1,4 @@
Apache Doris (incubating)
Spark Connector for Apache Doris (incubating)
Copyright 2018-2022 The Apache Software Foundation

This product includes software developed at
@@ -25,25 +25,38 @@

set -eo pipefail

ROOT=$(dirname "$0")
ROOT=$(cd "$ROOT"; pwd)

export DORIS_HOME=${ROOT}/../

usage() {
echo "
Usage:
$0 spark_version scala_version
$0 --spark version --scala version # specify spark and scala version
$0 --tag # this is a build from tag
e.g.:
$0 2.3.4 2.11
$0 3.1.2 2.12
$0 --spark 2.3.4 --scala 2.11
$0 --spark 3.1.2 --scala 2.12
$0 --tag
"
exit 1
}

if [ $# -ne 2 ]; then
OPTS=$(getopt \
-n $0 \
-o '' \
-o 'h' \
-l 'spark:' \
-l 'scala:' \
-l 'tag' \
-- "$@")

if [ $# == 0 ] ; then
usage
fi

ROOT=$(dirname "$0")
ROOT=$(cd "$ROOT"; pwd)

export DORIS_HOME=${ROOT}/../
eval set -- "$OPTS"

. "${DORIS_HOME}"/env.sh

@@ -52,15 +65,32 @@ if [[ -f ${DORIS_HOME}/custom_env.sh ]]; then
. "${DORIS_HOME}"/custom_env.sh
fi

BUILD_FROM_TAG=0
SPARK_VERSION=0
SCALA_VERSION=0
while true; do
case "$1" in
--spark) SPARK_VERSION=$2 ; shift 2 ;;
--scala) SCALA_VERSION=$2 ; shift 2 ;;
--tag) BUILD_FROM_TAG=1 ; shift ;;
--) shift ; break ;;
*) echo "Internal error" ; exit 1 ;;
esac
done

${MVN_BIN} clean package -Dscala.version=$2 -Dspark.version=$1
if [[ ${BUILD_FROM_TAG} -eq 1 ]]; then
rm -rf ${ROOT}/output/
${MVN_BIN} clean package
else
rm -rf ${ROOT}/output/
${MVN_BIN} clean package -Dspark.version=${SPARK_VERSION} -Dscala.version=${SCALA_VERSION}
fi

mkdir -p output/
cp target/doris-spark-*.jar ./output/
mkdir ${ROOT}/output/
cp ${ROOT}/target/doris-spark-*.jar ${ROOT}/output/

echo "*****************************************"
echo "Successfully build Spark-Doris-Connector"
echo "*****************************************"

exit 0

@@ -38,9 +38,9 @@
</license>
</licenses>
<scm>
<connection>scm:git:https://git@github.com/apache/incubator-doris.git</connection>
<developerConnection>scm:git:https://git@github.com/apache/incubator-doris.git</developerConnection>
<url>scm:git:https://git@github.com/apache/incubator-doris.git</url>
<connection>scm:git:https://git@github.com/apache/incubator-doris-spark-connector.git</connection>
<developerConnection>scm:git:https://git@github.com/apache/incubator-doris-spark-connector.git</developerConnection>
<url>scm:git:https://git@github.com/apache/incubator-doris-spark-connector.git</url>
<tag>HEAD</tag>
</scm>
<issueManagement>
@@ -215,6 +215,19 @@
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- add gensrc java build src dir -->
<plugin>
<groupId>org.codehaus.mojo</groupId>

0 comments on commit d2e3f7e

Please sign in to comment.