'Generic Commit'
Some checks failed
dropshell-build / build (push) Failing after 1m12s

This commit is contained in:
Your Name 2025-06-01 11:53:38 +12:00
parent 595d97efed
commit 11efaa3ff5

View File

@ -203,6 +203,9 @@ function buildspawn() {
fi
# make canonical
BUILD_DIR=$(realpath "$BUILD_DIR")
FLAGS=""
[ $MULTIBUILD -eq 0 ] || FLAGS="$FLAGS -m"
[ $RELEASE -eq 0 ] || FLAGS="$FLAGS -r"
BUILD_VERSION_FILE="$HOME/.config/dropshell-build/version"
if [ ! -f "$BUILD_VERSION_FILE" ]; then
@ -218,25 +221,38 @@ function buildspawn() {
fi
echo "Using Docker Buildchain with tag: $TAG"
# Handle Docker-in-Docker path mapping for Gitea Actions.
MOUNT_DIR="$BUILD_DIR"
if [ -n "${HOST_WORKSPACE_PATH-}" ]; then
# Convert container path to host path
# Gitea typically mounts workspace at /workspace in the container
# Replace /workspace with the actual host path
MOUNT_DIR=$(echo "$BUILD_DIR" | sed "s|^/workspace|$HOST_WORKSPACE_PATH|")
if [ "$MOUNT_DIR" != "$BUILD_DIR" ]; then
echo "Docker-in-Docker: Mapping $BUILD_DIR to $MOUNT_DIR"
fi
# Check if we're running in Gitea Actions
if [ -n "${JOB_CONTAINER_NAME:-}" ] && [ -n "${GITHUB_WORKSPACE:-}" ]; then
echo "--------------------------------"
echo "Running in Gitea Actions - using --volumes-from"
echo "--------------------------------"
echo "ls -la using --volumes-from"
echo "GITHUB_WORKSPACE: ${GITHUB_WORKSPACE}"
echo "BUILD_DIR: ${BUILD_DIR}"
echo "SCRIPT_DIR: ${SCRIPT_DIR}"
# shellcheck disable=SC2086
docker run --rm -i --entrypoint /bin/bash \
--volumes-from="${JOB_CONTAINER_NAME}" \
"gitea.jde.nz/public/dropshell-build:${TAG}" \
rm -rf /app && \
ln -s "${GITHUB_WORKSPACE}" /app && \
dropshell-build $FLAGS /app
else
echo "Running locally"
# shellcheck disable=SC2086
docker run --rm \
-u "$(id -u)":"$(id -g)" \
-v "$BUILD_DIR":/app \
"gitea.jde.nz/public/dropshell-build:${TAG}" \
dropshell-build $FLAGS /app
fi
docker run --rm \
-u "$(id -u)":"$(id -g)" \
-v "$MOUNT_DIR":/app \
"gitea.jde.nz/public/dropshell-build:${TAG}"
else
echo "Using local native buildchain"
build "$BUILD_DIR"
# shellcheck disable=SC2086
build $FLAGS "$BUILD_DIR"
fi
}