Skip to content

Commit

Permalink
Change redundant version adding to a check
Browse files Browse the repository at this point in the history
  • Loading branch information
ryn5 committed Jan 22, 2024
1 parent 85e0bae commit 76b5808
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,18 @@ jobs:
- name: View assembled file
run: ls -l tableau-connector/target

- name: Add version to TACO file
- name: Check version in TACO file name
run: |
file="./gradle.properties"
MAJOR_VERSION=$(grep "MAJOR_VERSION" ${file} | cut -d'=' -f2)
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/neptune-jdbc.taco tableau-connector/target/neptune-jdbc-$MAJOR_VERSION.$MINOR_VERSION.$PATCH_VERSION.taco
if [ ! -f "tableau-connector/target/neptune-jdbc-$MAJOR_VERSION.$MINOR_VERSION.$PATCH_VERSION.taco" ]
then
echo "Exiting because TACO is not named correctly with version"
exit 1
fi
- name: "Configure AWS credentials"
if: ${{env.SIGNING_ENABLED == 'true'}}
Expand Down
10 changes: 8 additions & 2 deletions tableau-connector/build.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,27 @@ echo "CURRENT_FOLDER=${CURRENT_FOLDER}"
TARGET_FOLDER="$CURRENT_FOLDER"/target
echo TARGET_FOLDER=${TARGET_FOLDER}
mkdir -p $TARGET_FOLDER
PROPERTIES="../gradle.properties"
MAJOR_VERSION=$(grep "MAJOR_VERSION" ${PROPERTIES} | cut -d'=' -f2)
MINOR_VERSION=$(grep "MINOR_VERSION" ${PROPERTIES} | cut -d'=' -f2)
PATCH_VERSION=$(grep "PATCH_VERSION" ${PROPERTIES} | cut -d'=' -f2)
TACO_NAME="neptune-jdbc-v${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}.taco"
echo TACO_NAME=${TACO_NAME}

echo "Building Docker Image"
docker build -t taco-builder $CURRENT_FOLDER --progress=plain --no-cache

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/neptune-jdbc.taco /output"
docker exec taco-builder sh -c "cp /tableau-sdk/connector-plugin-sdk/connector-packager/packaged-connector/$TACO_NAME /output"
echo "Verifying Tableau Connector"
docker exec taco-builder sh -c "ls -l /output"
docker exec taco-builder pwd
echo "Getting Logs"
docker cp taco-builder:/tableau-sdk/connector-plugin-sdk/connector-packager/packaging_logs.txt $TARGET_FOLDER
echo "Extracting Tableau Connector"
docker cp taco-builder:/output/neptune-jdbc.taco $TARGET_FOLDER
docker cp taco-builder:/output/$TACO_NAME $TARGET_FOLDER
echo "Checking Logs and Resulting TACO FILE in $TARGET_FOLDER"
ls -l $TARGET_FOLDER
docker stop taco-builder
Expand Down

0 comments on commit 76b5808

Please sign in to comment.