'Generic Commit'
Some checks failed
Build-Test-Publish / build (push) Failing after 1m45s

This commit is contained in:
Your Name
2025-06-14 16:58:11 +12:00
parent 50a9ffeaf0
commit 843af7248a
3 changed files with 26 additions and 8 deletions

View File

@@ -6,10 +6,20 @@ ARG CMAKE_BUILD_TYPE=Debug
# Set working directory
WORKDIR /app
# Create cache directories
RUN mkdir -p /ccache /build-cache
# Set up ccache
ENV CCACHE_DIR=/ccache
ENV CCACHE_COMPILERCHECK=content
ENV CCACHE_MAXSIZE=2G
COPY . .
# Configure and build with ccache
RUN mkdir -p /build && \
# Configure and build with ccache using cache mounts
RUN --mount=type=cache,target=/ccache \
--mount=type=cache,target=/build \
mkdir -p /build && \
cmake -G Ninja -S /app -B /build \
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
@@ -29,14 +39,18 @@ RUN mkdir -p /build && \
-DOPENSSL_INCLUDE_DIR=/usr/local/include \
${CMAKE_TOOLCHAIN_FILE:+-DCMAKE_TOOLCHAIN_FILE=$CMAKE_TOOLCHAIN_FILE}
# Build with cache mounts
RUN --mount=type=cache,target=/ccache \
--mount=type=cache,target=/build \
cmake --build /build --target run_prebuild_script
# Explicitly build dependencies first
RUN cmake --build /build --target run_prebuild_script
RUN cmake --build /build
RUN --mount=type=cache,target=/ccache \
--mount=type=cache,target=/build \
cmake --build /build
# Copy the built executable to a regular directory for the final stage
RUN mkdir -p /output && \
RUN --mount=type=cache,target=/build \
mkdir -p /output && \
find /build -type f -executable -name "*${PROJECT}*" -exec cp {} /output/${PROJECT} \; || \
find /build -type f -executable -exec cp {} /output/${PROJECT} \;

View File

@@ -11,6 +11,10 @@ rm -rf "${SCRIPT_DIR}/output"
mkdir -p "${SCRIPT_DIR}/output"
PROJECT="simple-object-server"
# Enable Docker buildkit for cache support
export DOCKER_BUILDKIT=1
docker build \
-t "gitea.jde.nz/public/${PROJECT}-build:latest" \
-f "${SCRIPT_DIR}/Dockerfile.dropshell-build" \

View File

@@ -78,7 +78,7 @@ bool load_config(const std::string& config_path, ServerConfig& config) {
}
}
ASSERT(config.object_store_path.empty(), "object_store_path is not empty");
// Test incremental build comment
return true;
} catch (const std::exception& e) {