🏡 index : ~doyle/rgit.git

author Jordan Doyle <jordan@doyle.la> 2024-09-30 0:52:31.0 +04:00:00
committer Jordan Doyle <jordan@doyle.la> 2024-09-30 2:09:32.0 +04:00:00
commit
8afea157a36d432ac68ff9e7d059e7405e44c0da [patch]
tree
e09997499fca1fa86ef1fe0613201d053eb4e12a
parent
4ba5e87549adb5193a08ed6f859d82afef36ca0a
download
8afea157a36d432ac68ff9e7d059e7405e44c0da.tar.gz

Fix docker builds



Diff

 Dockerfile               | 27 ++++++++++-----------------
 .github/workflows/ci.yml | 27 +++++++++++++++++++++------
 2 files changed, 21 insertions(+), 33 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index c49d0ed..1e45ea6 100644
--- a/Dockerfile
+++ a/Dockerfile
@@ -1,24 +1,11 @@
FROM rust:1.81-slim AS builder
FROM nixos/nix:2.24.9 AS builder

RUN rustup component add rustfmt
RUN apt-get update && apt-get install -y pkg-config clang cmake
RUN nix-channel --update
RUN echo "experimental-features = nix-command flakes" >> /etc/nix/nix.conf

COPY . /sources
WORKDIR /sources
RUN cargo build --release
WORKDIR /app
COPY . .

FROM debian:bookworm-slim
RUN nix build .#

# Install git and cleanup package lists.
# This is required for git-http-backend to work.
RUN apt-get update && \
    apt-get install -y git && \
    rm -rf /var/lib/apt/lists/*

COPY --from=builder /sources/target/release/rgit /rgit

COPY ./scripts/docker/entrypoint.sh .
RUN chmod +x entrypoint.sh

EXPOSE 8000
ENTRYPOINT ["/entrypoint.sh"]
CMD ["/app/result/bin/rgit"]
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index ead4831..cb38fcf 100644
--- a/.github/workflows/ci.yml
+++ a/.github/workflows/ci.yml
@@ -17,19 +17,20 @@
        with:
          command: check

  test:
    name: Test Suite
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: stable
          override: true
      - uses: actions-rs/cargo@v1
        with:
          command: test
  # TODO: the build for this started failing in 1b34a74891423e118c567368c95b7e04f3b9ca63
  #test:
  #  name: Test Suite
  #  runs-on: ubuntu-latest
  #  steps:
  #    - uses: actions/checkout@v2
  #    - uses: actions-rs/toolchain@v1
  #      with:
  #        profile: minimal
  #        toolchain: stable
  #        override: true
  #    - uses: actions-rs/cargo@v1
  #      with:
  #        command: test

  fmt:
    name: Rustfmt