Skip to content

Commit

Permalink
Move docker-action script to build directory, add extra comments
Browse files Browse the repository at this point in the history
  • Loading branch information
pflooky committed Jun 17, 2024
1 parent 16a8039 commit a3cd4a7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jobs:
distribution: 'temurin'
cache: 'sbt'
- name: Build and push images
run: bash docker-action.sh
run: bash build/docker-action.sh
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ You have to ensure that you local environment has the following:
docker run -d -i --name unitycatalog -p 8081:8081 datacatering/unitycatalog:0.1.0
```


In a terminal, in the cloned repository root directory, start the UC server.

```
Expand Down
12 changes: 9 additions & 3 deletions docker-action.sh → build/docker-action.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
#!/bin/bash

#Script to help create server and cli jar files via SBT. Then to build and push as Docker image.

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

run_sbt() {
SBT_COMMAND="./build/sbt -J-Xms4G -J-Xmx4G -info clean assembly"
SBT_COMMAND="$ROOT_DIR/build/sbt -J-Xms4G -J-Xmx4G -info clean assembly"
echo "Running SBT to generate Server and CLI JAR: $SBT_COMMAND"
$SBT_COMMAND || exit
}
Expand All @@ -23,10 +27,12 @@ if [ -z "$CLI_JAR" ]; then
run_sbt
fi

echo "Setting up docker for multi-platform builds using buildx"
docker run --privileged --rm tonistiigi/binfmt --install all
docker buildx create --use --name builder
docker buildx inspect --bootstrap builder

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

0 comments on commit a3cd4a7

Please sign in to comment.