diff --git a/.gitignore b/.gitignore index 0c0d985d..bc41b9c4 100644 --- a/.gitignore +++ b/.gitignore @@ -76,6 +76,8 @@ core/datacap-ui/yarn.lock # Qshell # .qshell/* +.ossutilconfig +.ossutil_checkpoint # Test # test/datacap-test-convert/*convertservice diff --git a/.qshell/account.json b/.qshell/account.json deleted file mode 100644 index e69de29b..00000000 diff --git a/configure/cloud.conf b/configure/cloud.conf index 9ee4c71e..92991b00 100644 --- a/configure/cloud.conf +++ b/configure/cloud.conf @@ -1,4 +1,5 @@ -BUCKET_NAME=devlive-north +BUCKET_NAME=devlive-cdn +OSS_ENDPOINT=oss-cn-beijing.aliyuncs.com PLUGIN_HOME=applications/datacap/plugins DATACAP_HOME=applications/datacap METADATA_HOME=applications/datacap/metadata \ No newline at end of file diff --git a/configure/publish/publish-oss-artifact.sh b/configure/publish/publish-oss-artifact.sh new file mode 100644 index 00000000..6840db38 --- /dev/null +++ b/configure/publish/publish-oss-artifact.sh @@ -0,0 +1,90 @@ +#!/bin/sh +HOME=$(pwd) + +VERSION=$(./mvnw -Dexec.executable='echo' -Dexec.args='${project.version}' --non-recursive exec:exec -Dorg.slf4j.simpleLogger.defaultLogLevel=WARN -Dorg.slf4j.simpleLogger.log.org.apache.maven.plugins.help=INFO | tail -1) + +echo "Publish artifact, usage version is ${VERSION}" + +CONF_FILE="${HOME}/configure/cloud.conf" +if [ -f "$CONF_FILE" ]; then + . "$CONF_FILE" +else + echo "The configuration file $CONF_FILE does not exist, please check the path." + exit 1 +fi + +PLUGIN_DIR="${HOME}/dist/plugins" +if [ ! -d "$PLUGIN_DIR" ]; then + echo "The directory $PLUGIN_DIR does not exist, please check the path." + exit 1 +fi + +echo "OSS Bucket Name: $BUCKET_NAME" +echo "OSS Endpoint: $OSS_ENDPOINT" +echo "Work Home: $PLUGIN_HOME" +echo "Datacap Home: $DATACAP_HOME" +echo "Metadata Home: $METADATA_HOME" + +# 确保 ossutil 已配置 +if ! command -v ossutil > /dev/null; then + echo "Error: ossutil is not installed. Please install it first." + echo "You can download it from: https://help.aliyun.com/document_detail/120075.html" + exit 1 +fi + +printf "============================================\n" +printf "Publish artifact ...\n" + +# Handle bin.tar.gz files +for file in "$HOME/dist"/*bin.tar.gz; do + if [ -e "$file" ]; then + filename=$(basename "$file") + echo "Uploading binary: $filename" + ossutil cp "$file" "oss://$BUCKET_NAME/$DATACAP_HOME/versions/$VERSION/$filename" -f + fi +done + +# Handle metadata file +METADATA_FILE="${HOME}/configure/metadata.json" +if [ -f "$METADATA_FILE" ]; then + # Upload new metadata file + echo "Uploading metadata file" + ossutil cp "$METADATA_FILE" "oss://$BUCKET_NAME/$METADATA_HOME/metadata.json" -f +fi + +# Original plugin upload logic +for file in "$PLUGIN_DIR"/*.tar.gz; do + if [ ! -e "$file" ]; then + echo "No tar.gz files found in directory $PLUGIN_DIR." + break + fi + + filename=$(basename "$file") + echo "Document found: $filename" + + case "$filename" in + datacap-executor-*) + target_dir="$PLUGIN_HOME/$VERSION/executor" + ;; + datacap-convert-*) + target_dir="$PLUGIN_HOME/$VERSION/convert" + ;; + datacap-fs-*) + target_dir="$PLUGIN_HOME/$VERSION/fs" + ;; + datacap-parser-*) + target_dir="$PLUGIN_HOME/$VERSION/parser" + ;; + datacap-scheduler-*) + target_dir="$PLUGIN_HOME/$VERSION/scheduler" + ;; + *) + target_dir="$PLUGIN_HOME/$VERSION/plugin" + ;; + esac + + echo "Uploading $filename to $target_dir" + ossutil cp "$file" "oss://$BUCKET_NAME/$target_dir/$filename" -f +done + +printf "============================================\n" \ No newline at end of file diff --git a/core/datacap-service/src/main/java/io/edurt/datacap/service/common/ConfigureUtils.java b/core/datacap-service/src/main/java/io/edurt/datacap/service/common/ConfigureUtils.java index d91356c5..f42cd955 100644 --- a/core/datacap-service/src/main/java/io/edurt/datacap/service/common/ConfigureUtils.java +++ b/core/datacap-service/src/main/java/io/edurt/datacap/service/common/ConfigureUtils.java @@ -7,7 +7,6 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import io.edurt.datacap.common.enums.ServiceState; import io.edurt.datacap.common.utils.BeanToPropertiesUtils; import io.edurt.datacap.common.utils.JsonUtils; -import io.edurt.datacap.executor.common.RunProtocol; import io.edurt.datacap.service.body.PipelineFieldBody; import io.edurt.datacap.service.configure.FieldType; import io.edurt.datacap.service.configure.IConfigure; @@ -277,9 +276,6 @@ public class ConfigureUtils originProperties.setProperty("context", query); } } - if (fieldBody.getProtocol().equals(RunProtocol.JDBC)) { - originProperties.setProperty("url", String.format("jdbc:%s://%s:%s/%s", entity.getType().toLowerCase(), entity.getHost(), entity.getPort(), entity.getDatabase())); - } return mergeProperties(entity, fields, originProperties); }