Skip to content

Commit

Permalink
Adapt packaging script to updated SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
kaklakariada committed Dec 7, 2023
1 parent 179b6f1 commit d49652d
Showing 1 changed file with 19 additions and 22 deletions.
41 changes: 19 additions & 22 deletions tools/package_connector.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ sdk_dir="$target_dir/sdk"
readonly sdk_dir
packager_dir="$sdk_dir/connector-packager/"
readonly packager_dir
packaged_connector_dir="$packager_dir/packaged-connector/"
readonly packaged_connector_dir

set_up_environment () {
clone_tableau_connector_plugin_sdk_repository
Expand Down Expand Up @@ -60,29 +58,28 @@ install_packaging_module () {
python setup.py install
}

package_connectors () {
echo "Clean output directory $packaged_connector_dir"
rm -rfv "$packaged_connector_dir"
echo "# Packaging odbc connector"
python -m connector_packager.package "$project_dir/src/exasol_odbc/"
if [ ! -f "$packaged_connector_dir/exasol_odbc.taco" ] ; then
echo "Warning: Packaging ODBC connector failed. See log output above."
exit 1
fi
package_connector () {
local -r type=$1
echo "# Packaging $type connector"
python -m connector_packager.package --verbose --dest "$target_dir" --log "$target_dir/logs_$type" "$project_dir/src/exasol_$type/"

echo "# Packaging jdbc connector"
python -m connector_packager.package "$project_dir/src/exasol_jdbc/"
if [ ! -f "$packaged_connector_dir/exasol_jdbc.taco" ] ; then
echo "Warning: Packaging JDBC connector failed. See log output above."
files=( "$target_dir"/exasol_"$type"-v*.taco )
if [ "${#files[@]}" -ge 2 ]
then
echo "ERROR: Found more than one file when building $type connector:" "${files[@]}"
exit 1
elif [ ! -e "${files[0]}" ]
then
echo "ERROR: Packaging $type connector failed, .taco file not found in $target_dir. See log output above."
exit 1
else
local -r file="${files[0]}"
local -r new_name="exasol_$type.taco"
echo "Successfully created $type connector: $file, rename to $new_name"
mv -v "$file" "$target_dir/$new_name"
fi
}

copy_packaged_connectors_to_target_folder () {
echo "# Copying packaged connectors to target folder"
cp -v "$packaged_connector_dir/exasol_odbc.taco" "$packaged_connector_dir/exasol_jdbc.taco" "$target_dir"
}

set_up_environment
package_connectors
copy_packaged_connectors_to_target_folder
package_connector odbc
package_connector jdbc

0 comments on commit d49652d

Please sign in to comment.