Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved plugable component architecture #64

Merged
merged 12 commits into from
Aug 25, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions birdhouse/env.local.example
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@ export POSTGRES_MAGPIE_PASSWORD=postgres-qwerty
#############################################################################

# Extra dirs containing docker-compose-extra.yml file to override the default
# docker-compose.yml file. Inside each extra dir, there must be a
# docker-compose-extra.yml file. If this file is not found, the dir is
# ignored.
# docker-compose.yml file and default.env file to provide extra defaults for
# each component.
#
# Useful to split configs into different dirs leveraging docker-compose
# override capabilities, see https://docs.docker.com/compose/extends/.
Expand Down
12 changes: 12 additions & 0 deletions birdhouse/pavics-compose.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,18 @@ cd $(dirname $(readlink -f $0 || realpath $0))
# we don't use usual .env filename, because docker-compose uses it
[ -f env.local ] && . ./env.local

for adir in ${EXTRA_CONF_DIRS}; do
COMPONENT_DEFAULT_ENV="$adir/default.env"
if [ -f "$COMPONENT_DEFAULT_ENV" ]; then
echo "reading '$COMPONENT_DEFAULT_ENV'"
. "$COMPONENT_DEFAULT_ENV"
fi
done

# Re-read env.local to make sure it can override ALL defaults from all
# components.
[ -f env.local ] && . ./env.local
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should indicate the priority of all those envs file somewhere?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same priority as before with the docker-compose-extra.yml fragment

# Last dir/docker-compose fragment in the list have highest override precedence.
# Ex: last docker-compose volume mount to same destination win over the
# previous docker-compose volume mount.

I can elaborate a little bit more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done be1581a


for i in ${VARS}
do
v="${i}"
Expand Down