Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Hotfix][Core][Shell] Fix bug that shell script about downloading plugins does not work #3462

Merged
merged 4 commits into from
Nov 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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