24 lines
601 B
Bash
Executable file
24 lines
601 B
Bash
Executable file
#!/bin/bash
|
|
set -e
|
|
cd "$(dirname "$(realpath "$0")")"
|
|
|
|
|
|
project_dir="$(dirname "$(dirname "$PWD")")"
|
|
tag="ruche-manager/ruche-manager:latest"
|
|
name="ruche-manager"
|
|
|
|
|
|
if ! [ -f "$project_dir/token" ]
|
|
then echo "ERROR : Needs discord API token in '$project_dir/token'" && exit
|
|
fi
|
|
|
|
docker remove --force "$name"
|
|
docker build --tag="$tag" --build-context=project="$project_dir" .
|
|
docker run \
|
|
--volume="$project_dir/token:/token" \
|
|
--volume="$project_dir/local:/ruche-manager/local" \
|
|
--user="$(id -u):$(id -g)" \
|
|
--restart="unless-stopped" \
|
|
--name="$name" \
|
|
--detach \
|
|
"$tag"
|