Files
dropshell/build.sh
Your Name 8348ea63a0
All checks were successful
Build-Test-Publish / build (linux/amd64) (push) Successful in 37s
Build-Test-Publish / build (linux/arm64) (push) Successful in 1m8s
feat: Update 2 files
2025-08-23 18:19:43 +12:00

38 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
set -euo pipefail
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
PROJECT="dropshell"
rm -rf "${SCRIPT_DIR}/output"
mkdir -p "${SCRIPT_DIR}/output"
# make sure we have the latest base image.
docker pull gitea.jde.nz/public/dropshell-build-base:latest
# Build with or without cache based on NO_CACHE environment variable
CACHE_FLAG=""
if [ "${NO_CACHE:-false}" = "true" ]; then
CACHE_FLAG="--no-cache"
fi
docker build \
${CACHE_FLAG} \
-t "${PROJECT}-build" \
-f "${SCRIPT_DIR}/Dockerfile.dropshell-build" \
--build-arg PROJECT="${PROJECT}" \
--build-arg CMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE:-Debug}" \
--output "${SCRIPT_DIR}/output" \
"${SCRIPT_DIR}"
# Auto-install dropshell locally if requested
if [ "${INSTALL_LOCAL:-true}" = "true" ]; then
INSTALL_DIR="${HOME}/.local/bin"
mkdir -p "${INSTALL_DIR}"
cp "${SCRIPT_DIR}/output/dropshell" "${INSTALL_DIR}/dropshell"
"${INSTALL_DIR}/dropshell" install
echo "Dropshell installed to ${INSTALL_DIR}/dropshell"
fi
echo "Build process completed!"