create build script

This commit is contained in:
Bryson Steck 2025-03-02 16:13:44 -07:00
parent a50c9bffdb
commit 6cfaf61246
Signed by: brysonsteck
SSH key fingerprint: SHA256:XpKABw/nP4z8UVaH+weLaBnEOD86+cVwif+QjuYLGT4
2 changed files with 20 additions and 1 deletions

View file

@ -1,4 +1,6 @@
FROM rust:slim
ARG UID="1000"
ARG GID="1000"
WORKDIR /usr/src/refractr
COPY . .
@ -6,4 +8,8 @@ COPY . .
RUN cargo build --release
RUN cargo install --locked --path .
RUN groupadd -g $GID refractr
RUN useradd -u $UID -g $GID -MN refractr
USER refractr
CMD ["refractr"]

13
build Executable file
View file

@ -0,0 +1,13 @@
#!/usr/bin/env bash
# Create all the different builds for refractr
set -x
version=$(cat Cargo.toml | grep -m1 version | awk -F' ' '{print $3}' | sed 's|"||g')
# docker builds
cargo clean
docker build -t refractr:$version .
docker tag refractr:$version refractr:$latest
# rust build
cargo build
cargo build --release