Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add global-bundle.pem to default cert list and Implement Dynamic .taco Filename Handling #571

Merged
merged 2 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ jobs:
MINOR_VERSION=$(grep "MINOR_VERSION" ${file} | cut -d'=' -f2)
PATCH_VERSION=$(grep "PATCH_VERSION" ${file} | cut -d'=' -f2)
echo "version=$MAJOR_VERSION.$MINOR_VERSION.$PATCH_VERSION" >> $GITHUB_ENV
mv tableau-connector/target/documentdbjdbc.taco tableau-connector/target/documentdbjdbc-$MAJOR_VERSION.$MINOR_VERSION.$PATCH_VERSION.taco
mv tableau-connector/target/*.taco tableau-connector/target/documentdbjdbc-$MAJOR_VERSION.$MINOR_VERSION.$PATCH_VERSION.taco

- name: "Configure AWS credentials"
if: ${{env.SIGNING_ENABLED == 'true'}}
Expand Down
6 changes: 4 additions & 2 deletions tableau-connector/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ WORKDIR /tableau-connector
ADD ./src .
WORKDIR /tableau-sdk
RUN git clone https://github.com/tableau/connector-plugin-sdk.git &&\
cd ./connector-plugin-sdk/connector-packager &&\
cd ./connector-plugin-sdk &&\
git checkout tags/tdvt-2.13.7 &&\
cd connector-packager &&\
python3 -m venv .venv &&\
source ./.venv/bin/activate &&\
python3 setup.py install &&\
python3 -m connector_packager.package /tableau-connector
ENTRYPOINT ["bash"]
ENTRYPOINT ["bash"]
39 changes: 34 additions & 5 deletions tableau-connector/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,49 @@ echo "CURRENT_FOLDER=${CURRENT_FOLDER}"
TARGET_FOLDER="$CURRENT_FOLDER"/target
echo TARGET_FOLDER=${TARGET_FOLDER}
mkdir -p $TARGET_FOLDER

echo "Created directory at: $TARGET_FOLDER"
echo "Building Docker Image"
docker build -t taco-builder $CURRENT_FOLDER

echo "Assembling Tableau Connector"
docker run -d -it --name=taco-builder --mount type=bind,source=$TARGET_FOLDER,target=/output taco-builder
echo "Copying Tableau Connector"
docker exec taco-builder sh -c "cp /tableau-sdk/connector-plugin-sdk/connector-packager/packaged-connector/documentdbjdbc.taco /output"
if [ $? -ne 0 ]; then
echo "Failed to run Docker container."
exit 1
fi

# Dynamically find the taco file to copy. Only one .taco file exists.
echo "Copying Tableau Connector to output directory"
docker exec taco-builder sh -c 'cp /tableau-sdk/connector-plugin-sdk/connector-packager/packaged-connector/*.taco /output/'
sunnie629 marked this conversation as resolved.
Show resolved Hide resolved
if [ $? -ne 0 ]; then
echo "Failed to copy .taco file to /output directory."
exit 1
fi

# Verify the Tableau Connector in the output directory
echo "Verifying Tableau Connector"
docker exec taco-builder sh -c "ls -l /output"
docker exec taco-builder pwd
echo "Extracting Tableau Connector"
docker cp taco-builder:/output/documentdbjdbc.taco $TARGET_FOLDER
echo "Extracting Tableau Connector to $TARGET_FOLDER"
TACO_FILE_NAME=$(docker exec taco-builder sh -c "ls /output/*.taco")
docker cp "taco-builder:$TACO_FILE_NAME" "$TARGET_FOLDER"
if [ $? -ne 0 ]; then
echo "Failed to copy .taco file from Docker container to target folder."
exit 1
fi
echo "Connector extracted to $TARGET_FOLDER/"
echo "Checking Resulting TACO FILE in $TARGET_FOLDER"
ls -l $TARGET_FOLDER
if [ $? -ne 0 ]; then
echo "Failed to list contents of $TARGET_FOLDER."
exit 1
fi
# Stop and remove Docker container
echo "Stopping and removing Docker container"
docker stop taco-builder
docker rm taco-builder
if [ $? -ne 0 ]; then
echo "Failed to stop or remove Docker container."
exit 1
fi
echo "Build process completed successfully."
Loading