Skip to content

Commit

Permalink
[Hotfix][Core][Shell] Fix bug that shell script about downloading plu…
Browse files Browse the repository at this point in the history
…gins does not work (#3462)

* [Hotfix][Core][Shell] Fix bug

* [Improve][Core][Shell] Improve the shell script of downloading plugins

* [Hotfix][Core][Shell] Improve plugin install shell

* [Hotfix][Core][Shell] Improve plugin install shell
  • Loading branch information
TyrantLucifer authored Nov 22, 2022
1 parent 8fe0dda commit 9e39b36
Showing 1 changed file with 44 additions and 28 deletions.
72 changes: 44 additions & 28 deletions bin/install-plugin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,64 +20,80 @@
#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

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
done < ${SEATUNNEL_HOME}/config/plugin_config

0 comments on commit 9e39b36

Please sign in to comment.