Skip to content

Commit

Permalink
Fix up relative directories in docker-action script
Browse files Browse the repository at this point in the history
  • Loading branch information
pflooky committed Jun 17, 2024
1 parent 7f4f3e6 commit 41d1e29
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions build/docker-action.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

SCRIPT_DIR="$(dirname "$(readlink -f "$0")")"
ROOT_DIR="$(dirname "$SCRIPT_DIR")"
APP_VERSION=$(awk -F ' := ' '{print $2}' version.sbt | tr -d '"')
APP_VERSION=$(awk -F ' := ' '{print $2}' "$ROOT_DIR/version.sbt" | tr -d '"')
PLATFORMS="linux/amd64,linux/arm64"

run_sbt() {
Expand All @@ -13,14 +13,14 @@ run_sbt() {
$SBT_COMMAND || exit
}

SERVER_TARGET_DIR="server/target"
SERVER_TARGET_DIR="$ROOT_DIR/server/target"
SERVER_JAR=$(find "$SERVER_TARGET_DIR" -name "unitycatalog-server*.jar" | head -n 1)
if [ -z "$SERVER_JAR" ]; then
echo "Server JAR not found starting with 'unitycatalog-server*' in the target directory '$SERVER_TARGET_DIR'."
run_sbt
fi

CLI_TARGET_DIR="examples/cli/target"
CLI_TARGET_DIR="$ROOT_DIR/examples/cli/target"
CLI_JAR=$(find "$CLI_TARGET_DIR" -name "unitycatalog-cli-*.jar" | head -n 1)
if [ -z "$CLI_JAR" ]; then
echo "CLI JAR not found starting with 'unitycatalog-cli-*' in the target directory '$CLI_TARGET_DIR'."
Expand All @@ -33,6 +33,4 @@ docker buildx create --use --name builder
docker buildx inspect --bootstrap builder

echo "Running Docker build command, version=$APP_VERSION, platforms=$PLATFORMS"
(cd "$ROOT_DIR/.."; docker buildx build \
--platform "$PLATFORMS" \
-t datacatering/unitycatalog:"$APP_VERSION" --push .)
docker buildx build -t datacatering/unitycatalog:"$APP_VERSION" -f "$ROOT_DIR/Dockerfile" --push "$ROOT_DIR"

0 comments on commit 41d1e29

Please sign in to comment.