This is an automated email from the ASF dual-hosted git repository.
wuchunfu pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-seatunnel.git
The following commit(s) were added to refs/heads/dev by this push:
new 9e39b3608 [Hotfix][Core][Shell] Fix bug that shell script about
downloading plugins does not work (#3462)
9e39b3608 is described below
commit 9e39b36086af1443e14d026da4143a7f41ab528f
Author: Tyrantlucifer <[email protected]>
AuthorDate: Tue Nov 22 13:40:12 2022 +0800
[Hotfix][Core][Shell] Fix bug that shell script about downloading plugins
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
---
bin/install-plugin.sh | 72 +++++++++++++++++++++++++++++++--------------------
1 file changed, 44 insertions(+), 28 deletions(-)
diff --git a/bin/install-plugin.sh b/bin/install-plugin.sh
index c4afa87e4..affe58e2d 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