25 lines
367 B
Bash
Executable file
25 lines
367 B
Bash
Executable file
#!/usr/bin/env sh
|
|
|
|
set -eu
|
|
suffix=$(printf '%s' "$1" | sed 's/.*\.//')
|
|
binary=tori
|
|
tag="$binary:$suffix"
|
|
shift
|
|
|
|
if podman container exists "$tag"; then
|
|
podman stop --time 3 "$tag"
|
|
fi
|
|
|
|
cd ..
|
|
cargo build
|
|
cd -
|
|
|
|
cp -v ../target/debug/$binary $binary
|
|
|
|
podman build \
|
|
--tag "$tag" \
|
|
-f "Containerfile.$suffix" "$@"
|
|
|
|
if [ -f $binary ]; then
|
|
rm -v $binary
|
|
fi
|