simplify script and add more information

This commit is contained in:
Karol Wypchlo 2022-08-12 21:06:04 +02:00
parent 747bc1659a
commit 063f0b0b7b
No known key found for this signature in database
GPG Key ID: B515DE9EEBE241E1
1 changed files with 5 additions and 7 deletions

12
dc
View File

@ -5,15 +5,13 @@
# would use docker-compose with the only difference being that you don't need to specify compose files. For more
# information you can run `./dc` or `./dc help`.
# get current working directory of this script
# get current working directory of this script and prefix all files with it to
# be able to call this script from anywhere and not only root directory of
# skynet-webportal project
cwd="$(dirname -- "$0";)";
if [ -f ${cwd}/.env ]; then
OLD_IFS=$IFS
IFS=$'\n'
for x in $(grep -v '^#.*' ${cwd}/.env); do export $x; done
IFS=$OLD_IFS
fi
# get portal modules configuration from .env file (if defined more than once, the last one is used)
PORTAL_MODULES=$(grep -e "^PORTAL_MODULES=" ${cwd}.env | tail -1 | sed "s/PORTAL_MODULES=//")
# include base docker compose file
COMPOSE_FILES="-f ${cwd}/docker-compose.yml"