Archived
2
0
This repository has been archived on 2024-06-24. You can view files and clone it, but cannot push or open issues or pull requests.
neko-custom/.docker/rebuild-server

26 lines
675 B
Plaintext
Raw Normal View History

2021-04-02 10:18:50 +13:00
#!/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" \
2023-03-18 08:47:53 +13:00
-e GIT_COMMIT=`git rev-parse --short HEAD` \
-e GIT_BRANCH=`git rev-parse --symbolic-full-name --abbrev-ref HEAD` \
-e GIT_DIRTY=`git diff-index --quiet HEAD -- || echo "✗-"` \
--entrypoint="bash" \
--workdir="/src" \
neko_dev_server ./build