Use a template for project config

This commit is contained in:
Akis Kesoglou 2018-06-12 12:45:07 +03:00
parent 8025a51c6a
commit f4a614ede2
2 changed files with 12 additions and 1 deletions

10
compose/template.yml Normal file
View File

@ -0,0 +1,10 @@
# Project-specific config.
#
# All paths must be defined relative to `compose/services.yml` regardless of
# the location of this file, i.e. refer to `my-open-balena-checkout/somedir`
# as `../somedir`. This is because of the way docker-compose handles paths
# when specifying multiple configs and open-balena always specifying
# `compose/services.yml` as the "base" config.
#
# You may view the effective config with `scripts/run-fig-command config`.
version: '2.1'

View File

@ -4,6 +4,7 @@ set -e
CMD=$0
DIR=$(dirname "$CMD")
BASE_DIR=$(dirname "$DIR")
PROJECT_NAME=${1:-demo}
HOST_NAME=${2:-openbalena.local}
@ -48,7 +49,7 @@ $("${DIR}/make-env" \
STR
echo_bold "==> Adding default compose file..."
echo "version: '2.1'" >"${PROJECT_DIR}/docker-compose.yml"
cp "${BASE_DIR}/compose/template.yml" "${PROJECT_DIR}/docker-compose.yml"
# FIXME: should be explicitly requested via a flag
echo_bold "==> Patching /etc/hosts..."