diqiu50 commented on code in PR #5073: URL: https://github.com/apache/gravitino/pull/5073#discussion_r1819980750
########## trino-connector/integration-test/trino-test-tools/download_jar.sh: ########## @@ -0,0 +1,86 @@ +#!/bin/bash +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +set -e +#!/bin/bash + +# Function to download a JAR file if it does not already exist +download_jar() { + local jar_file_name=$1 + local download_url=$2 + local target_directory=$3 + + if [ ! -d "$target_directory" ]; then + echo "Target directory does not exist. Creating directory: $target_directory" + mkdir -p "$target_directory" + fi + + local full_path="$target_directory/$jar_file_name" + + if [ ! -f "$full_path" ]; then + echo "Downloading $jar_file_name..." + curl -L -o "$full_path" "$download_url" + if [ $? -ne 0 ]; then + echo "Download failed for $jar_file_name" + exit 1 + fi + echo "$jar_file_name downloaded successfully." + else + echo "$jar_file_name already exists." + fi +} + +# Specific functions for each driver or bundle +download_mysql_jar() { + download_jar "mysql-connector-java-8.0.26.jar" \ + "https://repo1.maven.org/maven2/mysql/mysql-connector-java/8.0.26/mysql-connector-java-8.0.26.jar" \ Review Comment: There generally shouldn’t be any issues here. If an issue does occur, the download script will raise an error, exit execution, and output the error message. Let’s fix it later if any issues arise. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
