This commit is contained in:
23
publish.sh
23
publish.sh
@@ -6,6 +6,9 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
||||
|
||||
echo "Publishing simple-object-server to gitea.jde.nz/public/simple-object-server:latest"
|
||||
|
||||
PROJECT="simple-object-server"
|
||||
|
||||
|
||||
# FUNCTIONS
|
||||
function title() {
|
||||
echo "----------------------------------------"
|
||||
@@ -24,9 +27,13 @@ function die() {
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Create buildx builder if it doesn't exist
|
||||
docker buildx create --name ${PROJECT}-multiarch --use \
|
||||
--driver-opt env.BUILDKIT_MAX_PARALLELISM=4 \
|
||||
2>/dev/null || docker buildx use ${PROJECT}-multiarch
|
||||
|
||||
function build() {
|
||||
local PLATFORM="$1"
|
||||
local PROJECT="simple-object-server"
|
||||
|
||||
# convert linux/amd64 to linux-amd64, windows/amd64 to windows-amd64, etc.
|
||||
local OSARCH="${PLATFORM//\//-}"
|
||||
@@ -34,13 +41,13 @@ function build() {
|
||||
title "Building ${PROJECT} for ${PLATFORM}"
|
||||
|
||||
docker buildx build \
|
||||
-t "gitea.jde.nz/public/${PROJECT}-build:latest" \
|
||||
-f "${SCRIPT_DIR}/Dockerfile.dropshell-build" \
|
||||
--build-arg PROJECT="${PROJECT}" \
|
||||
--build-arg CMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" \
|
||||
--output "${SCRIPT_DIR}/output/${OSARCH}" \
|
||||
--platform "${PLATFORM}" \
|
||||
"${SCRIPT_DIR}"
|
||||
-t "gitea.jde.nz/public/${PROJECT}-build:latest" \
|
||||
-f "${SCRIPT_DIR}/Dockerfile.dropshell-build" \
|
||||
--build-arg PROJECT="${PROJECT}" \
|
||||
--build-arg CMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" \
|
||||
--output "${SCRIPT_DIR}/output/${OSARCH}" \
|
||||
--platform "${PLATFORM}" \
|
||||
"${SCRIPT_DIR}"
|
||||
|
||||
mv "${SCRIPT_DIR}/output/${OSARCH}/${PROJECT}" "${SCRIPT_DIR}/output/${PROJECT}-${OSARCH}"
|
||||
rm -rf "${SCRIPT_DIR}/output/${OSARCH}"
|
||||
|
Reference in New Issue
Block a user