diff --git a/bin/install-plugin.sh b/bin/install-plugin.sh index c4afa87e420..affe58e2d12 100644 --- a/bin/install-plugin.sh +++ b/bin/install-plugin.sh @@ -20,6 +20,9 @@ #All are downloaded by default. You can also choose what you need. #You only need to configure the plug-in name in config/plugin_config. +# get seatunnel home +SEATUNNEL_HOME=$(cd $(dirname $0);cd ../;pwd) + # connector default version is 2.2.0, you can also choose a custom version. eg: 2.1.2: sh install-plugin.sh 2.1.2 version=2.2.0 @@ -27,57 +30,70 @@ if [ -n "$1" ]; then version="$1" fi -echo "Install SeaTunnel connectors plugins, usage version is $version $1" +echo "Install SeaTunnel connectors plugins, usage version is ${version}" -if [ ! -d connectors ]; +# create the connectors directory +if [ ! -d ${SEATUNNEL_HOME}/connectors ]; then - mkdir connectors + mkdir ${SEATUNNEL_HOME}/connectors echo "create connectors directory" -fi -if [ ! -d connectors/flink-sql ]; +fi + +# create the flink-sql connectors directory (for v1) +if [ ! -d ${SEATUNNEL_HOME}/connectors/flink-sql ]; then - mkdir connectors/flink-sql + mkdir ${SEATUNNEL_HOME}/connectors/flink-sql echo "create flink-sql connectors directory" fi -if [ ! -d connectors/flink ]; + +# create the flink connectors directory (for v1) +if [ ! -d ${SEATUNNEL_HOME}/connectors/flink ]; then - mkdir connectors/flink + mkdir ${SEATUNNEL_HOME}/connectors/flink echo "create flink connectors directory" -fi -if [ ! -d connectors/spark ]; +fi + +# create the spark connectors directory (for v1) +if [ ! -d ${SEATUNNEL_HOME}/connectors/spark ]; then - mkdir connectors/spark + mkdir ${SEATUNNEL_HOME}/connectors/spark echo "create spark connectors directory" -fi -if [ ! -d connectors/seatunnel ]; +fi + +# create the seatunnel connectors directory (for v2) +if [ ! -d ${SEATUNNEL_HOME}/connectors/seatunnel ]; then - mkdir connectors/seatunnel + mkdir ${SEATUNNEL_HOME}/connectors/seatunnel echo "create seatunnel connectors directory" fi path=flink-sql while read line; do - if [ ${line:0:1} != "-" ] && [ ${line:0:1} != "#" ] - then - echo "install connector : " $line - ./mvnw dependency:get -DgroupId=org.apache.seatunnel -DartifactId=${line} -Dversion=${version} -Ddest=connectors/${path} - fi + # v1 connectors flink-sql if [ "$line" = "--flink-sql-connectors--" ] - then + then path=flink-sql - fi + fi + # v1 connectors flink if [ "$line" = "--flink-connectors--" ] - then + then path=flink - fi + fi + # v1 connectors spark if [ "$line" = "--spark-connectors--" ] - then + then path=spark - fi + fi + # v2 connectors if [ "$line" = "--connectors-v2--" ] - then + then path=seatunnel - fi + fi + if [ ${line:0:1} != "-" ] && [ ${line:0:1} != "#" ] + then + echo "install connector : " $line + ${SEATUNNEL_HOME}/mvnw dependency:get -DgroupId=org.apache.seatunnel -DartifactId=${line} -Dversion=${version} -Ddest=${SEATUNNEL_HOME}/connectors/${path} + fi -done < config/plugin_config \ No newline at end of file +done < ${SEATUNNEL_HOME}/config/plugin_config \ No newline at end of file