easy development tools.

This commit is contained in:
m1k1o
2021-04-01 23:18:50 +02:00
parent 24699ec512
commit 70860ab83c
7 changed files with 165 additions and 5 deletions

21
.m1k1o/rebuild-server Executable file
View File

@ -0,0 +1,21 @@
#!/bin/bash
if [ -f ".env.default" ]
then
export $(cat .env.default | sed 's/#.*//g' | xargs)
fi
if [ -f ".env" ]
then
export $(cat .env | sed 's/#.*//g' | xargs)
fi
# use -f to force rebuild
if [ "$(docker images -q neko_dev_server 2> /dev/null)" == "" ] || [ "$1" == "-f" ]; then
docker build -t neko_dev_server -f base/Dockerfile --target server ../
fi
docker run --rm -it \
-v "${PWD}/../server:/src" \
--entrypoint="go" \
neko_dev_server build -o "bin/neko" -i "cmd/neko/main.go"