|
|
@ -21,35 +21,22 @@ DS_VERSION=$1 |
|
|
|
DATABASE_VERSION=${DS_VERSION//\./} |
|
|
|
DATABASE_VERSION=${DS_VERSION//\./} |
|
|
|
|
|
|
|
|
|
|
|
# Install Atlas and Create Dir |
|
|
|
# Install Atlas and Create Dir |
|
|
|
mkdir -p ds_schema_check_test/dev ds_schema_check_test/${DS_VERSION} |
|
|
|
mkdir -p ds_schema_check_test/dev |
|
|
|
curl -sSf https://atlasgo.sh | sh |
|
|
|
curl -sSf https://atlasgo.sh | sh |
|
|
|
|
|
|
|
|
|
|
|
# Preparing the environment |
|
|
|
# Preparing the environment |
|
|
|
if [ ! -f /tmp/${DS_VERSION}/apache-dolphinscheduler-${DS_VERSION}-bin.tar.gz ]; then |
|
|
|
docker pull apache/dolphinscheduler-tools:${DS_VERSION} |
|
|
|
wget https://archive.apache.org/dist/dolphinscheduler/${DS_VERSION}/apache-dolphinscheduler-${DS_VERSION}-bin.tar.gz -P ds_schema_check_test/${DS_VERSION} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
mv /tmp/${DS_VERSION}/apache-dolphinscheduler-${DS_VERSION}-bin.tar.gz ds_schema_check_test/${DS_VERSION} |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
tar -xzf ds_schema_check_test/${DS_VERSION}/apache-dolphinscheduler-${DS_VERSION}-bin.tar.gz -C ds_schema_check_test/${DS_VERSION} --strip-components 1 |
|
|
|
|
|
|
|
tar -xzf ds_schema_check_test/dev/apache-dolphinscheduler-*-bin.tar.gz -C ds_schema_check_test/dev --strip-components 1 |
|
|
|
tar -xzf ds_schema_check_test/dev/apache-dolphinscheduler-*-bin.tar.gz -C ds_schema_check_test/dev --strip-components 1 |
|
|
|
|
|
|
|
|
|
|
|
if [[ $DATABASE_VERSION -lt 300 ]]; then |
|
|
|
chmod +x ds_schema_check_test/dev/tools/bin/upgrade-schema.sh |
|
|
|
chmod +x ds_schema_check_test/dev/tools/bin/upgrade-schema.sh ds_schema_check_test/${DS_VERSION}/script/create-dolphinscheduler.sh |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
chmod +x ds_schema_check_test/dev/tools/bin/upgrade-schema.sh ds_schema_check_test/${DS_VERSION}/tools/bin/upgrade-schema.sh |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MYSQL_JDBC_URL="https://repo.maven.apache.org/maven2/mysql/mysql-connector-java/8.0.16/mysql-connector-java-8.0.16.jar" |
|
|
|
MYSQL_JDBC_URL="https://repo.maven.apache.org/maven2/mysql/mysql-connector-java/8.0.16/mysql-connector-java-8.0.16.jar" |
|
|
|
MYSQL_JDBC_JAR="mysql-connector-java-8.0.16.jar" |
|
|
|
MYSQL_JDBC_JAR="mysql-connector-java-8.0.16.jar" |
|
|
|
wget ${MYSQL_JDBC_URL} -O ds_schema_check_test/${MYSQL_JDBC_JAR} |
|
|
|
wget ${MYSQL_JDBC_URL} -O ds_schema_check_test/${MYSQL_JDBC_JAR} |
|
|
|
for base_dir in ds_schema_check_test/dev ds_schema_check_test/${DS_VERSION}; do |
|
|
|
for base_dir in ds_schema_check_test/dev; do |
|
|
|
if [[ $base_dir == *"dolphinscheduler/2"* ]]; then |
|
|
|
|
|
|
|
cp ds_schema_check_test/${MYSQL_JDBC_JAR} ${base_dir}/lib |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
for d in alert-server api-server master-server worker-server tools; do |
|
|
|
for d in alert-server api-server master-server worker-server tools; do |
|
|
|
cp ds_schema_check_test/${MYSQL_JDBC_JAR} ${base_dir}/${d}/libs |
|
|
|
cp ds_schema_check_test/${MYSQL_JDBC_JAR} ${base_dir}/${d}/libs |
|
|
|
done |
|
|
|
done |
|
|
|
fi |
|
|
|
|
|
|
|
done |
|
|
|
done |
|
|
|
docker compose -f .github/workflows/schema-check/mysql/docker-compose-base.yaml up -d --wait |
|
|
|
docker compose -f .github/workflows/schema-check/mysql/docker-compose-base.yaml up -d --wait |
|
|
|
docker exec -i mysql mysql -uroot -pmysql -e "create database dolphinscheduler_${DATABASE_VERSION}"; |
|
|
|
docker exec -i mysql mysql -uroot -pmysql -e "create database dolphinscheduler_${DATABASE_VERSION}"; |
|
|
|