Update 2 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

This commit is contained in:
Your Name
2025-06-29 22:47:41 +12:00
parent 344d62034c
commit 3d21d1da7d
2 changed files with 42 additions and 20 deletions

View File

@ -28,15 +28,19 @@ COMMAND_TO_RUN="
if [ -n "${GITEA_CONTAINER_NAME:-}" ]; then
echo "We're in a gitea container: ${GITEA_CONTAINER_NAME}"
echo "Checking cmake availability..."
which cmake || echo "cmake not found in PATH"
echo "PATH: $PATH"
echo "Sourcing build environment..."
# Source the standard build environment if available
[ -f /etc/profile ] && source /etc/profile
[ -f ~/.bashrc ] && source ~/.bashrc
# Add common binary paths
export PATH="/usr/local/bin:/usr/bin:/bin:$PATH"
cd "${SCRIPT_DIR}" && ls -la . && ${COMMAND_TO_RUN}
if which cmake >/dev/null 2>&1; then
echo "cmake found, building directly"
cd "${SCRIPT_DIR}" && ${COMMAND_TO_RUN}
else
echo "cmake not found in CI environment, using docker build instead"
docker run --rm \
-v "${SCRIPT_DIR}:/app:ro" \
-v "${SCRIPT_DIR}/build:/app/build" \
-v "${SCRIPT_DIR}/output:/app/output" \
-e CMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE:-Debug}" \
gitea.jde.nz/public/dropshell-build-base:latest \
bash -c "cd /app && ${COMMAND_TO_RUN}"
fi
else
echo "Building in new docker container"
docker run --rm \
@ -46,7 +50,7 @@ else
-v "${SCRIPT_DIR}/output:/app/output" \
-e CMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE:-Debug}" \
gitea.jde.nz/public/dropshell-build-base:latest \
bash -c "cd /app &&${COMMAND_TO_RUN}"
bash -c "cd /app && ${COMMAND_TO_RUN}"
fi
echo "Build complete"

View File

@ -25,16 +25,34 @@ COMMAND_TO_RUN="cmake -G Ninja -S . -B ./build \
if [ -n "${GITEA_CONTAINER_NAME:-}" ]; then
echo "We're in a gitea container: ${GITEA_CONTAINER_NAME}"
echo "Checking cmake availability..."
which cmake || echo "cmake not found in PATH"
echo "PATH: $PATH"
echo "Sourcing build environment..."
# Source the standard build environment if available
[ -f /etc/profile ] && source /etc/profile
[ -f ~/.bashrc ] && source ~/.bashrc
# Add common binary paths
export PATH="/usr/local/bin:/usr/bin:/bin:$PATH"
cd "${SCRIPT_DIR}" && ls -la . && ${COMMAND_TO_RUN}
echo "=== ENVIRONMENT DEBUG ==="
echo "Image info:"
cat /etc/os-release 2>/dev/null || echo "No /etc/os-release"
echo "Available in /usr/local/bin:"
ls -la /usr/local/bin/ 2>/dev/null || echo "No /usr/local/bin"
echo "Available in /usr/bin (cmake related):"
ls -la /usr/bin/ | grep cmake || echo "No cmake in /usr/bin"
echo "Current PATH: $PATH"
echo "Checking for cmake..."
find /usr -name "cmake" 2>/dev/null || echo "cmake not found anywhere in /usr"
echo "========================="
# Try to use cmake directly since we should be in the build image
export PATH="/usr/local/bin:/usr/bin:$PATH"
if which cmake >/dev/null 2>&1; then
echo "cmake found, building directly"
cd "${SCRIPT_DIR}" && ${COMMAND_TO_RUN}
else
echo "ERROR: cmake not available in build image - this shouldn't happen!"
echo "Falling back to nested docker (not ideal)"
docker run --rm \
-v "${SCRIPT_DIR}:/app:ro" \
-v "${SCRIPT_DIR}/build:/app/build" \
-v "${SCRIPT_DIR}/output:/app/output" \
-e CMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE:-Debug}" \
gitea.jde.nz/public/dropshell-build-base:latest \
bash -c "cd /app && ${COMMAND_TO_RUN}"
fi
else
echo "Building in new docker container"
docker run --rm \