
Some checks failed
Build-Test-Publish / build (linux/amd64) (push) Failing after 1m49s
Build-Test-Publish / build (linux/arm64) (push) Failing after 2m9s
Build-Test-Publish / test-install-from-scratch (linux/amd64) (push) Has been skipped
Build-Test-Publish / test-install-from-scratch (linux/arm64) (push) Has been skipped
26 lines
761 B
Bash
Executable File
26 lines
761 B
Bash
Executable File
#!/bin/bash
|
|
# build.sh using docker run approach
|
|
|
|
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
|
PROJECT="dehydrate"
|
|
|
|
# Create persistent build directory
|
|
mkdir -p "${SCRIPT_DIR}/build"
|
|
mkdir -p "${SCRIPT_DIR}/output"
|
|
|
|
# Run build in container with mounted directories
|
|
docker run --rm \
|
|
--user "$(id -u):$(id -g)" \
|
|
-v "${SCRIPT_DIR}:/src:ro" \
|
|
-v "${SCRIPT_DIR}/build:/build" \
|
|
-v "${SCRIPT_DIR}/output:/output" \
|
|
-e CMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE:-Debug}" \
|
|
gitea.jde.nz/public/dropshell-build-base:latest \
|
|
bash -c "
|
|
cd /build && \
|
|
cmake -G Ninja -S /src -B . \
|
|
-DCMAKE_BUILD_TYPE=\${CMAKE_BUILD_TYPE} \
|
|
-DPROJECT_NAME=${PROJECT} && \
|
|
cmake --build . && \
|
|
cp ${PROJECT} /output/
|
|
" |