Skip to content

Commit

Permalink
improve and speed up container release build
Browse files Browse the repository at this point in the history
  • Loading branch information
sebadob committed Jun 26, 2024
1 parent 0dc96ce commit 8faf6be
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 9 deletions.
14 changes: 13 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,20 @@ RUN echo "Building on $BUILDPLATFORM for $TARGETOS/$TARGETARCH in $MODE mode wit

RUN mkdir -p out && mkdir empty

COPY . .
COPY data ./data
COPY migrations ./migrations
COPY src ./src
COPY static ./static
COPY templates ./templates
COPY tls ./tls
COPY .env .
COPY Cargo.lock .
COPY Cargo.toml .
COPY rauthy.cfg .
COPY rauthy.deploy.cfg .
COPY rauthy.test.cfg .
#RUN --mount=type=cache,target=/usr/local/cargo/registry <<EOF

RUN <<EOF
#!/bin/bash
if [ "release" = "$MODE" ]; then
Expand Down
19 changes: 11 additions & 8 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -403,14 +403,17 @@ build mode="release" no-test="test" image="ghcr.io/sebadob/rauthy": build-ui
set -euxo pipefail
# sqlite
if [ {{no-test}} != "no-test" ]; then
echo "make sure clippy is fine with sqlite"
just _run cargo clippy -- -D warnings
echo "run tests against sqlite"
just test-sqlite
else
just prepare
fi
#if [ {{no-test}} != "no-test" ]; then
# echo "make sure clippy is fine with sqlite"
# just _run cargo clippy -- -D warnings
# echo "run tests against sqlite"
# just test-sqlite
#else
# just prepare
#fi

# make sure any big testing sqlite backups are cleaned up to speed up docker build
rm -rf data/backup

echo "build sqlite release"
docker buildx build \
Expand Down

0 comments on commit 8faf6be

Please sign in to comment.