refractr/build

24 lines
816 B
Text
Raw Normal View History

#!/bin/sh
2025-03-02 16:13:44 -07:00
# Create all the different builds for refractr
2025-03-02 16:13:44 -07:00
version=$(cat Cargo.toml | grep -m1 version | awk -F' ' '{print $3}' | sed 's|"||g')
uid=$(id -u)
gid=$(id -g)
2025-03-02 18:33:33 -07:00
cargo update
cargo clean
2025-03-02 16:13:44 -07:00
# docker builds
docker build -t refractr:$version --build-arg UID=$uid --build-arg GID=$gid --build-arg VERSION=$version -f package.Dockerfile .
docker tag refractr:$version refractr:latest
if test "$1" = "push"; then
docker tag refractr:$version git.brysonsteck.xyz/brysonsteck/refractr:latest
docker tag refractr:$version git.brysonsteck.xyz/brysonsteck/refractr:$version
docker push -a git.brysonsteck.xyz/brysonsteck/refractr
docker image rm git.brysonsteck.xyz/brysonsteck/refractr:latest
docker image rm git.brysonsteck.xyz/brysonsteck/refractr:$version
fi
2025-03-02 16:13:44 -07:00
# rust build
cargo build
cargo build --release