2021-09-13 13:51:22 +02:00
|
|
|
#! /usr/bin/env bash
|
|
|
|
|
2022-10-25 14:33:33 +02:00
|
|
|
CONNECTORS="db2 mongodb mysql oracle postgres sqlserver"
|
|
|
|
OPTS=$(getopt -o d:o:c: --long dir:,output:,connectors: -n 'parse-options' -- "$@")
|
2021-09-13 13:51:22 +02:00
|
|
|
if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi
|
|
|
|
eval set -- "$OPTS"
|
|
|
|
|
|
|
|
OUTPUT="$(pwd)/artifacts.txt"
|
|
|
|
while true; do
|
|
|
|
case "$1" in
|
2022-04-26 15:01:00 +02:00
|
|
|
-d | --dir ) DIR=$2; shift; shift ;;
|
2021-09-13 13:51:22 +02:00
|
|
|
-o | --output ) OUTPUT=$2; shift; shift ;;
|
2022-10-25 14:33:33 +02:00
|
|
|
-c | --connectors ) CONNECTORS=$2; shift; shift ;;
|
2021-09-13 13:51:22 +02:00
|
|
|
-h | --help ) PRINT_HELP=true; shift ;;
|
|
|
|
-- ) shift; break ;;
|
|
|
|
* ) break ;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
2022-12-01 13:06:24 +01:00
|
|
|
shopt -s globstar
|
2021-09-13 13:51:22 +02:00
|
|
|
pushd "$DIR" || exit
|
|
|
|
rm -f "$OUTPUT"
|
2022-10-25 14:33:33 +02:00
|
|
|
for connector in ${CONNECTORS}; do
|
2022-12-01 13:06:24 +01:00
|
|
|
file=""
|
|
|
|
if [[ $(ls **/*"${connector}"*.zip) ]]; then
|
|
|
|
file=$(ls **/*"${connector}"*.zip)
|
|
|
|
fi
|
2022-10-25 14:33:33 +02:00
|
|
|
artifact="debezium-connector-$connector"
|
2021-09-13 13:51:22 +02:00
|
|
|
echo "$artifact"
|
2022-10-25 14:33:33 +02:00
|
|
|
echo "$artifact::$file" >> "$OUTPUT"
|
2021-09-13 13:51:22 +02:00
|
|
|
done
|
2022-04-26 15:01:00 +02:00
|
|
|
|
2022-10-25 14:33:33 +02:00
|
|
|
|
2022-04-26 15:01:00 +02:00
|
|
|
scripting=$(ls **/*scripting*.{zip,jar})
|
|
|
|
artifact="debezium-scripting"
|
|
|
|
echo "$artifact"
|
|
|
|
echo "$artifact::$scripting" >> "$OUTPUT"
|
|
|
|
|
|
|
|
converter=$(ls **/*converter*.{zip,jar})
|
|
|
|
artifact="connect-converter"
|
|
|
|
echo "$artifact"
|
|
|
|
echo "$artifact::$converter" >> "$OUTPUT"
|
|
|
|
|
|
|
|
for driver in **/jdbc/*.{zip,jar}; do
|
|
|
|
name=$(echo "$driver" | sed -rn 's@^(.*)-([[:digit:]].*([[:digit:]]|Final|SNAPSHOT))(.*)(\..*)$@\1@p')
|
|
|
|
artifact="$name"
|
2022-12-01 13:06:24 +01:00
|
|
|
if [[ ! $artifact ]]; then
|
|
|
|
continue
|
|
|
|
fi
|
2022-04-26 15:01:00 +02:00
|
|
|
echo "$artifact"
|
|
|
|
echo "$artifact::$driver" >> "$OUTPUT"
|
|
|
|
done
|
|
|
|
|
2022-06-01 12:48:17 +02:00
|
|
|
for groovy_script in **/groovy/*.{zip,jar}; do
|
|
|
|
name=$(echo "$groovy_script" | sed -rn 's@^(.*)-[0-9]\..*$@\1@p')
|
|
|
|
artifact="$name"
|
2022-12-01 13:06:24 +01:00
|
|
|
if [[ ! $artifact ]]; then
|
|
|
|
continue
|
|
|
|
fi
|
2022-06-01 12:48:17 +02:00
|
|
|
echo "$artifact"
|
|
|
|
echo "$artifact::$groovy_script" >> "$OUTPUT"
|
|
|
|
done
|
|
|
|
|
2022-04-26 15:01:00 +02:00
|
|
|
popd || exit
|