2020-11-19 09:50:16 -05:00
|
|
|
#! /bin/bash
|
|
|
|
|
|
|
|
goal=
|
2023-08-17 10:44:35 -04:00
|
|
|
if [ "$RDBMS" == "h2" ]; then
|
2022-10-11 08:35:57 -04:00
|
|
|
# This is the default.
|
|
|
|
goal=""
|
2022-11-03 10:15:01 -04:00
|
|
|
elif [ "$RDBMS" == "hsqldb" ] || [ "$RDBMS" == "hsqldb_2_6" ]; then
|
|
|
|
goal="-Pdb=hsqldb"
|
2024-07-05 11:44:15 -04:00
|
|
|
elif [ "$RDBMS" == "mysql" ] || [ "$RDBMS" == "mysql_8_0" ]; then
|
2021-10-04 04:10:48 -04:00
|
|
|
goal="-Pdb=mysql_ci"
|
2024-07-05 11:44:15 -04:00
|
|
|
elif [ "$RDBMS" == "mariadb" ] || [ "$RDBMS" == "mariadb_10_4" ]; then
|
2021-02-03 04:55:07 -05:00
|
|
|
goal="-Pdb=mariadb_ci"
|
2024-07-05 11:44:15 -04:00
|
|
|
elif [ "$RDBMS" == "postgresql" ] || [ "$RDBMS" == "postgresql_12" ]; then
|
2021-02-03 04:55:07 -05:00
|
|
|
goal="-Pdb=pgsql_ci"
|
2024-07-05 11:44:15 -04:00
|
|
|
elif [ "$RDBMS" == "edb" ] || [ "$RDBMS" == "edb_12" ]; then
|
2022-11-03 10:15:01 -04:00
|
|
|
goal="-Pdb=edb_ci -DdbHost=localhost:5444"
|
2023-01-04 05:15:43 -05:00
|
|
|
elif [ "$RDBMS" == "oracle" ]; then
|
2023-08-21 06:42:00 -04:00
|
|
|
goal="-Pdb=oracle_ci"
|
2024-07-05 11:44:15 -04:00
|
|
|
elif [ "$RDBMS" == "oracle_xe" ] || [ "$RDBMS" == "oracle_21" ]; then
|
2023-06-30 09:18:16 -04:00
|
|
|
# I have no idea why, but these tests don't seem to work on CI...
|
|
|
|
goal="-Pdb=oracle_xe_ci"
|
2024-02-14 05:29:21 -05:00
|
|
|
elif [ "$RDBMS" == "oracle_atps_tls" ]; then
|
2023-09-21 09:42:43 -04:00
|
|
|
echo "Managing Oracle Autonomous Database..."
|
|
|
|
export INFO=$(curl -s -k -L -X GET "https://api.atlas-controller.oraclecloud.com/ords/atlas/admin/database?type=autonomous&hostname=`hostname`" -H 'accept: application/json')
|
|
|
|
export HOST=$(echo $INFO | jq -r '.database' | jq -r '.host')
|
|
|
|
export SERVICE=$(echo $INFO | jq -r '.database' | jq -r '.service')
|
|
|
|
# I have no idea why, but these tests don't seem to work on CI...
|
|
|
|
goal="-Pdb=oracle_cloud_autonomous_tls -DrunID=$RUNID -DdbHost=$HOST -DdbService=$SERVICE"
|
2024-02-14 05:29:21 -05:00
|
|
|
elif [ "$RDBMS" == "oracle_atps" ]; then
|
|
|
|
echo "Managing Oracle Autonomous Database..."
|
2024-02-14 05:34:13 -05:00
|
|
|
export INFO=$(curl -s -k -L -X GET "https://api.atlas-controller.oraclecloud.com/ords/atlas/admin/database?type=autonomous2&hostname=`hostname`" -H 'accept: application/json')
|
2024-02-14 05:29:21 -05:00
|
|
|
export HOST=$(echo $INFO | jq -r '.database' | jq -r '.host')
|
|
|
|
export SERVICE=$(echo $INFO | jq -r '.database' | jq -r '.service')
|
|
|
|
# I have no idea why, but these tests don't seem to work on CI...
|
|
|
|
goal="-Pdb=oracle_cloud_autonomous -DrunID=$RUNID -DdbHost=$HOST -DdbService=$SERVICE"
|
2023-09-21 09:42:43 -04:00
|
|
|
elif [ "$RDBMS" == "oracle_db19c" ]; then
|
|
|
|
echo "Managing Oracle Database 19c..."
|
|
|
|
export INFO=$(curl -s -k -L -X GET "https://api.atlas-controller.oraclecloud.com/ords/atlas/admin/database?type=db19c&hostname=`hostname`" -H 'accept: application/json')
|
|
|
|
export HOST=$(echo $INFO | jq -r '.database' | jq -r '.host')
|
|
|
|
export SERVICE=$(echo $INFO | jq -r '.database' | jq -r '.service')
|
|
|
|
# I have no idea why, but these tests don't seem to work on CI...
|
|
|
|
goal="-Pdb=oracle_cloud_db19c -DrunID=$RUNID -DdbHost=$HOST -DdbService=$SERVICE"
|
|
|
|
elif [ "$RDBMS" == "oracle_db21c" ]; then
|
|
|
|
echo "Managing Oracle Database 21c..."
|
|
|
|
export INFO=$(curl -s -k -L -X GET "https://api.atlas-controller.oraclecloud.com/ords/atlas/admin/database?type=db21c&hostname=`hostname`" -H 'accept: application/json')
|
|
|
|
export HOST=$(echo $INFO | jq -r '.database' | jq -r '.host')
|
|
|
|
export SERVICE=$(echo $INFO | jq -r '.database' | jq -r '.service')
|
|
|
|
# I have no idea why, but these tests don't seem to work on CI...
|
|
|
|
goal="-Pdb=oracle_cloud_db21c -DrunID=$RUNID -DdbHost=$HOST -DdbService=$SERVICE"
|
|
|
|
elif [ "$RDBMS" == "oracle_db23c" ]; then
|
|
|
|
echo "Managing Oracle Database 23c..."
|
|
|
|
export INFO=$(curl -s -k -L -X GET "https://api.atlas-controller.oraclecloud.com/ords/atlas/admin/database?type=db23c&hostname=`hostname`" -H 'accept: application/json')
|
|
|
|
export HOST=$(echo $INFO | jq -r '.database' | jq -r '.host')
|
|
|
|
export SERVICE=$(echo $INFO | jq -r '.database' | jq -r '.service')
|
|
|
|
# I have no idea why, but these tests don't seem to work on CI...
|
|
|
|
goal="-Pdb=oracle_cloud_db23c -DrunID=$RUNID -DdbHost=$HOST -DdbService=$SERVICE"
|
2020-11-19 09:50:16 -05:00
|
|
|
elif [ "$RDBMS" == "db2" ]; then
|
2021-02-03 04:55:07 -05:00
|
|
|
goal="-Pdb=db2_ci"
|
2022-11-03 10:15:01 -04:00
|
|
|
elif [ "$RDBMS" == "db2_10_5" ]; then
|
|
|
|
goal="-Pdb=db2"
|
|
|
|
elif [ "$RDBMS" == "mssql" ] || [ "$RDBMS" == "mssql_2017" ]; then
|
2021-02-03 04:55:07 -05:00
|
|
|
goal="-Pdb=mssql_ci"
|
2021-06-23 08:56:57 -04:00
|
|
|
elif [ "$RDBMS" == "sybase" ]; then
|
|
|
|
goal="-Pdb=sybase_ci"
|
2023-08-07 09:54:44 -04:00
|
|
|
elif [ "$RDBMS" == "sybase_jconn" ]; then
|
|
|
|
goal="-Pdb=sybase_jconn_ci"
|
2022-10-11 08:35:57 -04:00
|
|
|
elif [ "$RDBMS" == "tidb" ]; then
|
|
|
|
goal="-Pdb=tidb"
|
2022-11-03 10:15:01 -04:00
|
|
|
elif [ "$RDBMS" == "hana_cloud" ]; then
|
|
|
|
goal="-Pdb=hana_cloud"
|
2023-09-04 10:51:59 -04:00
|
|
|
elif [ "$RDBMS" == "cockroachdb" ]; then
|
2022-09-23 11:43:11 -04:00
|
|
|
goal="-Pdb=cockroachdb"
|
2023-11-13 21:24:17 -05:00
|
|
|
elif [ "$RDBMS" == "altibase" ]; then
|
|
|
|
goal="-Pdb=altibase"
|
2024-06-07 08:51:13 -04:00
|
|
|
elif [ "$RDBMS" == "informix" ]; then
|
|
|
|
goal="-Pdb=informix"
|
2020-11-19 09:50:16 -05:00
|
|
|
fi
|
|
|
|
|
2024-09-17 02:47:10 -04:00
|
|
|
# Disable checkstyle
|
2024-09-14 13:10:52 -04:00
|
|
|
#if [ -n "$goal" ]; then
|
2024-09-17 02:47:10 -04:00
|
|
|
goal="$goal -x checkstyleMain -DPOPULATE_REMOTE=true"
|
2024-09-14 13:10:52 -04:00
|
|
|
#fi
|
2022-10-11 08:50:18 -04:00
|
|
|
|
2022-10-12 02:29:22 -04:00
|
|
|
function logAndExec() {
|
|
|
|
echo 1>&2 "Executing:" "${@}"
|
|
|
|
exec "${@}"
|
|
|
|
}
|
|
|
|
|
2023-11-07 04:54:42 -05:00
|
|
|
logAndExec ./gradlew check ${goal} "${@}" -Plog-test-progress=true --stacktrace
|