From 269e6129274322f1e98a21d512616f01b4295162 Mon Sep 17 00:00:00 2001 From: John Morris Date: Fri, 10 Apr 2015 13:09:56 -0500 Subject: [PATCH] Source local config Addresses #9, "Add local config override file". As stated there, this needs to have distro/package configs in bash associative arrays to work for overriding package and distro configuration; e.g. DISTRO_MIRROR[jessie]=http://http.us.debian.org/debian --- .gitignore | 2 ++ local-config-example.sh | 18 ++++++++++++++++++ scripts/init-cli.sh | 5 +++++ 3 files changed, 25 insertions(+) create mode 100644 local-config-example.sh diff --git a/.gitignore b/.gitignore index 1872ae8..af78da8 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,5 @@ /docker/ # apt package repository /repo/ +# local config +/local-config.sh diff --git a/local-config-example.sh b/local-config-example.sh new file mode 100644 index 0000000..a1f3a0b --- /dev/null +++ b/local-config-example.sh @@ -0,0 +1,18 @@ +# dbuild local configuration example +# +# Copy this file to `local-config.sh` and customize for your site +# +# The below examples are intended for many use cases; see +# `scripts/base-config.sh`, `scripts/packages/*.sh` and +# `scripts/distro/*.sh` for more variables to customize + +# http/https proxy for package downloads +#HTTP_PROXY=http://192.168.0.42:3128 + +# Whether to always allocate a tty in Docker (true/false) +# +# A bug in Docker pre-1.1.1 prevents command exit status from the +# `docker run` command when a tty is allocated. Set to `false` if you +# need exit status from Docker. +#DOCKER_ALWAYS_ALLOCATE_TTY=true + diff --git a/scripts/init-cli.sh b/scripts/init-cli.sh index 968b501..8d153ea 100644 --- a/scripts/init-cli.sh +++ b/scripts/init-cli.sh @@ -204,6 +204,11 @@ if test -n "$PACKAGE"; then . $PACKAGE_CONFIG_DIR/$PACKAGE.sh fi +# Source optional config override file +if test -f $BASE_DIR/local-config.sh; then + debug " Sourcing local config" + . $BASE_DIR/local-config.sh +fi # Debug ! $DDEBUG || set -x