dk: support de .compose.env pour le nom du projet

This commit is contained in:
Jephté Clain 2018-10-09 19:12:07 +04:00
parent 9d991e2d43
commit 4f7cb900d2
1 changed files with 13 additions and 2 deletions

13
dk
View File

@ -80,9 +80,20 @@ function compose_set_env_args() {
if [ -f docker-compose.override.yml ]; then if [ -f docker-compose.override.yml ]; then
replace_env_args+=(-f docker-compose.override.yml) replace_env_args+=(-f docker-compose.override.yml)
fi fi
if [ -n "$profile" -a -f "docker-compose.$profile.yml" ]; then local PROJECT_NAME=--none--
[ -f .compose.env ] && source ./.compose.env
if [ -n "$profile" ]; then
if [ -f "docker-compose.$profile.yml" ]; then
replace_env_args+=(-f "docker-compose.$profile.yml") replace_env_args+=(-f "docker-compose.$profile.yml")
fi fi
if [ "$PROJECT_NAME" != --none-- ]; then
if [ -z "$COMPOSE_PROJECT_NAME" ]; then
[ -n "$PROJECT_NAME" ] || PROJECT_NAME="$(basename -- "$(pwd)")"
COMPOSE_PROJECT_NAME="${PROJECT_NAME}_${profile}"
fi
export COMPOSE_PROJECT_NAME
fi
fi
} }
function initialize_build_env() { function initialize_build_env() {