Tidying
This commit is contained in:
parent
6df9ca87cb
commit
780e4a75f7
@ -3,8 +3,19 @@
|
|||||||
# Create volume if it doesn't exist
|
# Create volume if it doesn't exist
|
||||||
docker volume create cppbuild-cache
|
docker volume create cppbuild-cache
|
||||||
|
|
||||||
|
# Directory to copy the executable to
|
||||||
OUTDIR="output"
|
OUTDIR="output"
|
||||||
|
|
||||||
|
# Build command to run in the container
|
||||||
|
BUILD_COMMAND="mkdir -p /app/build && \
|
||||||
|
cd /app/build && \
|
||||||
|
cmake -G Ninja /app/src && \
|
||||||
|
ninja -j$(nproc) && \
|
||||||
|
mkdir /app/src/$OUTDIR && \
|
||||||
|
cp /app/build/ipdemo /app/src/$OUTDIR/ipdemo && \
|
||||||
|
chown -R $(id -u):$(id -g) /app/src/$OUTDIR"
|
||||||
|
|
||||||
|
# Run the build in the container
|
||||||
docker run --rm \
|
docker run --rm \
|
||||||
-v cppbuild-cache:/app/build \
|
-v cppbuild-cache:/app/build \
|
||||||
-v $(pwd):/app/src \
|
-v $(pwd):/app/src \
|
||||||
@ -16,14 +27,9 @@ docker run --rm \
|
|||||||
-e CMAKE_BUILD_PARALLEL_LEVEL=$(nproc) \
|
-e CMAKE_BUILD_PARALLEL_LEVEL=$(nproc) \
|
||||||
-e NINJA_STATUS="[%f/%t] " \
|
-e NINJA_STATUS="[%f/%t] " \
|
||||||
cpp-httplib-builder:latest \
|
cpp-httplib-builder:latest \
|
||||||
-c "mkdir -p /app/build && \
|
-c "$BUILD_COMMAND"
|
||||||
cd /app/build && \
|
|
||||||
cmake -G Ninja /app/src && \
|
|
||||||
ninja -j$(nproc) && \
|
|
||||||
mkdir /app/src/$OUTDIR && \
|
|
||||||
cp /app/build/ipdemo /app/src/$OUTDIR/ipdemo && \
|
|
||||||
chown -R $(id -u):$(id -g) /app/src/$OUTDIR"
|
|
||||||
|
|
||||||
|
# Run the executable if it exists
|
||||||
if [ -f $OUTDIR/ipdemo ]; then
|
if [ -f $OUTDIR/ipdemo ]; then
|
||||||
$OUTDIR/ipdemo
|
$OUTDIR/ipdemo
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user