From 6e329683c78581a5aa46f1f1bdf565197f1c9d89 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 29 May 2025 17:47:57 +1200 Subject: [PATCH] :-'Generic Commit' --- publish.sh | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/publish.sh b/publish.sh index 82f4e59..046c1a6 100755 --- a/publish.sh +++ b/publish.sh @@ -5,9 +5,9 @@ set -e # DIRECTORIES SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) -CACHE_DIR="${SCRIPT_DIR}/cache" +#CACHE_DIR="${SCRIPT_DIR}/cache" EXE_DIR="${SCRIPT_DIR}/output" -BUILD_DIR="${SCRIPT_DIR}/build" +#BUILD_DIR="${SCRIPT_DIR}/build" # FUNCTIONS function title() { @@ -31,7 +31,7 @@ function die() { #-------------------------------- # MAIN #-------------------------------- -cd $SCRIPT_DIR +cd "$SCRIPT_DIR" # build the executables ./build.sh all @@ -39,16 +39,25 @@ cd $SCRIPT_DIR # push the Docker image to the registry -if [ ! -f ${EXE_DIR}/simple_object_storage.amd64 ]; then +if [ ! -f "${EXE_DIR}/simple_object_storage.amd64" ]; then die "amd64 executable not found" fi -if [ ! -f ${EXE_DIR}/simple_object_storage.arm64 ]; then +if [ ! -f "${EXE_DIR}/simple_object_storage.arm64" ]; then die "arm64 executable not found" fi +# if the builder doesn't exist, create it +if ! docker buildx ls | grep -q "sos-builder"; then + docker buildx create --name sos-builder --use +else + docker buildx use sos-builder +fi + echo "Building multi-platform Docker image" docker buildx build --push -t gitea.jde.nz/public/simple-object-storage:latest --platform linux/amd64,linux/arm64 . echo "Build completed successfully!" +# switch back to the default builder +docker buildx use default \ No newline at end of file