refractr/build

23 lines
816 B
Bash
Executable file

#!/bin/sh
# Create all the different builds for refractr
version=$(cat Cargo.toml | grep -m1 version | awk -F' ' '{print $3}' | sed 's|"||g')
uid=$(id -u)
gid=$(id -g)
cargo update
cargo clean
# 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
# rust build
cargo build
cargo build --release