DBZ-5767 Reflecting downstream name changes

This commit is contained in:
jcechace 2022-10-25 14:33:33 +02:00 committed by Jakub Cechacek
parent 179c359ca6
commit 55783d9303
3 changed files with 21 additions and 5 deletions

View File

@ -1,6 +1,7 @@
#! /usr/bin/env bash #! /usr/bin/env bash
OPTS=$(getopt -o d:o: --long dir:,output: -n 'parse-options' -- "$@") CONNECTORS="db2 mongodb mysql oracle postgres sqlserver"
OPTS=$(getopt -o d:o:c: --long dir:,output:,connectors: -n 'parse-options' -- "$@")
if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi
eval set -- "$OPTS" eval set -- "$OPTS"
@ -9,6 +10,7 @@ while true; do
case "$1" in case "$1" in
-d | --dir ) DIR=$2; shift; shift ;; -d | --dir ) DIR=$2; shift; shift ;;
-o | --output ) OUTPUT=$2; shift; shift ;; -o | --output ) OUTPUT=$2; shift; shift ;;
-c | --connectors ) CONNECTORS=$2; shift; shift ;;
-h | --help ) PRINT_HELP=true; shift ;; -h | --help ) PRINT_HELP=true; shift ;;
-- ) shift; break ;; -- ) shift; break ;;
* ) break ;; * ) break ;;
@ -18,13 +20,15 @@ done
shopt -s globstar nullglob shopt -s globstar nullglob
pushd "$DIR" || exit pushd "$DIR" || exit
rm -f "$OUTPUT" rm -f "$OUTPUT"
for connector in **/*connector*.{zip,jar}; do for connector in ${CONNECTORS}; do
name=$(echo "$connector" | sed -rn 's@^(.*)-[0-9]*\..*$@\1@p') file=$(ls **/*${connector}*.zip)
artifact="$name"
artifact="debezium-connector-$connector"
echo "$artifact" echo "$artifact"
echo "$artifact::$connector" >> "$OUTPUT" echo "$artifact::$file" >> "$OUTPUT"
done done
scripting=$(ls **/*scripting*.{zip,jar}) scripting=$(ls **/*scripting*.{zip,jar})
artifact="debezium-scripting" artifact="debezium-scripting"
echo "$artifact" echo "$artifact"

View File

@ -47,6 +47,12 @@ for archive in ${ARCHIVE_URLS}; do
echo "[Processing] ${archive}" echo "[Processing] ${archive}"
curl -OJs "${archive}" && unzip \*.zip && rm *.zip curl -OJs "${archive}" && unzip \*.zip && rm *.zip
connectors_version=$(echo "$archive" | sed -rn 's|.*AMQ-CDC-(.*)/.*$|\1|p') connectors_version=$(echo "$archive" | sed -rn 's|.*AMQ-CDC-(.*)/.*$|\1|p')
if [ -z "$connectors_version" ]; then
echo "[Processing] unable to parse connectors version, trying different approach"
connectors_version=$(echo "$archive" | rev | cut -d '/' -f 1 | rev | cut -d '-' -f 2)
fi
echo "[Processing] connectors version is ${connectors_version}"
done done
connector_dirs=$(ls) connector_dirs=$(ls)

View File

@ -53,6 +53,12 @@ for archive in ${ARCHIVE_URLS}; do
mkdir -p "${dest}" && pushd ${dest} && curl -OJs "${lib}" && popd || exit mkdir -p "${dest}" && pushd ${dest} && curl -OJs "${lib}" && popd || exit
fi fi
connectors_version=$(echo "$archive" | sed -rn 's|.*AMQ-CDC-(.*)/.*$|dbz-\1|p') connectors_version=$(echo "$archive" | sed -rn 's|.*AMQ-CDC-(.*)/.*$|dbz-\1|p')
if [ -z "$connectors_version" ]; then
echo "[Processing] unable to parse connectors version, trying different approach"
connectors_version=$(echo "$archive" | rev | cut -d '/' -f 1 | rev | cut -d '-' -f 2)
fi
echo "[Processing] connectors version is ${connectors_version}"
done done
for input in ${EXTRA_LIBS}; do for input in ${EXTRA_LIBS}; do