Update 4 files
Some checks failed
Build-Test-Publish / build (linux/amd64) (push) Failing after 7s
Build-Test-Publish / build (linux/arm64) (push) Failing after 8s
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
Some checks failed
Build-Test-Publish / build (linux/amd64) (push) Failing after 7s
Build-Test-Publish / build (linux/arm64) (push) Failing after 8s
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
This commit is contained in:
@ -1,5 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# build.sh using docker run approach
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
# Get script directory - handle different execution contexts
|
# Get script directory - handle different execution contexts
|
||||||
@ -8,28 +7,27 @@ if [ -n "${BASH_SOURCE[0]}" ]; then
|
|||||||
else
|
else
|
||||||
SCRIPT_DIR="$( cd "$( dirname "$0" )" &> /dev/null && pwd )"
|
SCRIPT_DIR="$( cd "$( dirname "$0" )" &> /dev/null && pwd )"
|
||||||
fi
|
fi
|
||||||
|
PROJECT="$(basename "$(dirname "${SCRIPT_DIR}")")"
|
||||||
|
|
||||||
PROJECT="dehydrate"
|
|
||||||
|
|
||||||
# Debug output for CI
|
# Debug output for CI
|
||||||
echo "Build script running from: ${SCRIPT_DIR}"
|
echo "${PROJECT} build script running from: ${SCRIPT_DIR}"
|
||||||
echo "Current directory: $(pwd)"
|
|
||||||
echo "CMakeLists.txt exists: $([ -f "${SCRIPT_DIR}/CMakeLists.txt" ] && echo "yes" || echo "no")"
|
mkdir -p "${SCRIPT_DIR}/build"
|
||||||
|
mkdir -p "${SCRIPT_DIR}/output"
|
||||||
|
|
||||||
# Run build in container with mounted directories
|
# Run build in container with mounted directories
|
||||||
docker run --rm \
|
docker run --rm \
|
||||||
--user "$(id -u):$(id -g)" \
|
--user "$(id -u):$(id -g)" \
|
||||||
-v "${SCRIPT_DIR}:/src:ro" \
|
-v "${SCRIPT_DIR}:/app" \
|
||||||
-v "${SCRIPT_DIR}/build:/build" \
|
-w /app \
|
||||||
-v "${SCRIPT_DIR}/output:/output" \
|
|
||||||
-e CMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE:-Debug}" \
|
-e CMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE:-Debug}" \
|
||||||
gitea.jde.nz/public/dropshell-build-base:latest \
|
gitea.jde.nz/public/dropshell-build-base:latest \
|
||||||
bash -c "
|
bash -c "
|
||||||
mkdir -p /build /output && \
|
cd /app/build && \
|
||||||
cd /build && \
|
cmake -G Ninja -S /app -B /app/build \
|
||||||
cmake -G Ninja -S /src -B . \
|
|
||||||
-DCMAKE_BUILD_TYPE=\${CMAKE_BUILD_TYPE} \
|
-DCMAKE_BUILD_TYPE=\${CMAKE_BUILD_TYPE} \
|
||||||
-DPROJECT_NAME=${PROJECT} && \
|
-DPROJECT_NAME=${PROJECT} && \
|
||||||
cmake --build . && \
|
cmake --build /app/build && \
|
||||||
cp ${PROJECT} /output/
|
cp ${PROJECT} /app/output/
|
||||||
"
|
"
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
||||||
PROJECT="dehydrate"
|
PROJECT="$(basename "$(dirname "${SCRIPT_DIR}")")"
|
||||||
|
|
||||||
echo "Cleaning ${PROJECT}..."
|
echo "Cleaning ${PROJECT}..."
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# build.sh using docker run approach
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
# Get script directory - handle different execution contexts
|
# Get script directory - handle different execution contexts
|
||||||
@ -8,31 +7,27 @@ if [ -n "${BASH_SOURCE[0]}" ]; then
|
|||||||
else
|
else
|
||||||
SCRIPT_DIR="$( cd "$( dirname "$0" )" &> /dev/null && pwd )"
|
SCRIPT_DIR="$( cd "$( dirname "$0" )" &> /dev/null && pwd )"
|
||||||
fi
|
fi
|
||||||
|
PROJECT="$(basename "$(dirname "${SCRIPT_DIR}")")"
|
||||||
|
|
||||||
PROJECT="getpkg"
|
|
||||||
|
|
||||||
# Debug output for CI
|
# Debug output for CI
|
||||||
echo "Build script running from: ${SCRIPT_DIR}"
|
echo "${PROJECT} build script running from: ${SCRIPT_DIR}"
|
||||||
echo "Current directory: $(pwd)"
|
|
||||||
echo "CMakeLists.txt exists: $([ -f "${SCRIPT_DIR}/CMakeLists.txt" ] && echo "yes" || echo "no")"
|
mkdir -p "${SCRIPT_DIR}/build"
|
||||||
echo "Contents of script directory:"
|
mkdir -p "${SCRIPT_DIR}/output"
|
||||||
ls -la "${SCRIPT_DIR}"
|
|
||||||
|
|
||||||
# Run build in container with mounted directories
|
# Run build in container with mounted directories
|
||||||
docker run --rm \
|
docker run --rm \
|
||||||
--user "$(id -u):$(id -g)" \
|
--user "$(id -u):$(id -g)" \
|
||||||
-v "${SCRIPT_DIR}:/src:ro" \
|
-v "${SCRIPT_DIR}:/app" \
|
||||||
-v "${SCRIPT_DIR}/build:/build" \
|
-w /app \
|
||||||
-v "${SCRIPT_DIR}/output:/output" \
|
|
||||||
-e CMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE:-Debug}" \
|
-e CMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE:-Debug}" \
|
||||||
gitea.jde.nz/public/dropshell-build-base:latest \
|
gitea.jde.nz/public/dropshell-build-base:latest \
|
||||||
bash -c "
|
bash -c "
|
||||||
echo 'Contents of /src:' && ls -la /src && \
|
cd /app/build && \
|
||||||
mkdir -p /build /output && \
|
cmake -G Ninja -S /app -B /app/build \
|
||||||
cd /build && \
|
|
||||||
cmake -G Ninja -S /src -B . \
|
|
||||||
-DCMAKE_BUILD_TYPE=\${CMAKE_BUILD_TYPE} \
|
-DCMAKE_BUILD_TYPE=\${CMAKE_BUILD_TYPE} \
|
||||||
-DPROJECT_NAME=${PROJECT} && \
|
-DPROJECT_NAME=${PROJECT} && \
|
||||||
cmake --build . && \
|
cmake --build /app/build && \
|
||||||
cp ${PROJECT} /output/
|
cp ${PROJECT} /app/output/
|
||||||
"
|
"
|
||||||
|
@ -3,22 +3,16 @@
|
|||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
||||||
PROJECT="getpkg"
|
PROJECT="$(basename "$(dirname "${SCRIPT_DIR}")")"
|
||||||
|
|
||||||
echo "Cleaning ${PROJECT}..."
|
echo "Cleaning ${PROJECT}..."
|
||||||
|
|
||||||
# Remove output directory
|
# Remove output and build directories
|
||||||
if [ -d "${SCRIPT_DIR}/output" ]; then
|
for dir in "output" "build"; do
|
||||||
echo "Removing output directory..."
|
if [ -d "${SCRIPT_DIR}/${dir}" ]; then
|
||||||
rm -rf "${SCRIPT_DIR}/output"
|
echo "Removing ${dir} directory..."
|
||||||
fi
|
rm -rf "${SCRIPT_DIR:?}/${dir}"
|
||||||
|
fi
|
||||||
# Remove Docker images related to this project
|
done
|
||||||
echo "Removing Docker images..."
|
|
||||||
docker images --filter "reference=${PROJECT}-build*" -q | xargs -r docker rmi -f
|
|
||||||
|
|
||||||
# Remove Docker build cache
|
|
||||||
echo "Pruning Docker build cache..."
|
|
||||||
docker builder prune -f
|
|
||||||
|
|
||||||
echo "✓ ${PROJECT} cleaned successfully"
|
echo "✓ ${PROJECT} cleaned successfully"
|
Reference in New Issue
Block a user