open-balena/scripts/compose
Rich Bayliss 709d00b898
init: Make scripts macOS compatible
The quickstart script should be able to run on macOS machines
and not just Linux ones.

Signed-off-by: Rich Bayliss <rich@balena.io>
Change-type: patch
2018-12-20 10:42:50 +00:00

27 lines
618 B
Bash
Executable File

#!/bin/bash -e
source "${BASH_SOURCE%/*}/_realpath"
CMD="$(realpath "$0")"
DIR="$(dirname "${CMD}")"
BASE_DIR="$(dirname "${DIR}")"
CONFIG_DIR="${BASE_DIR}/config"
echo_bold() {
printf "\\033[1m%s\\033[0m\\n" "$@"
}
ENV_FILE="${CONFIG_DIR}/activate"
if [ ! -f "$ENV_FILE" ]; then
echo_bold 'No configuration found; please create one first with: ./scripts/quickstart'
echo_bold 'See README.md for help.'
exit 1
fi
# shellcheck source=/dev/null
source "${ENV_FILE}"; docker-compose \
--project-name 'openbalena' \
-f "${BASE_DIR}/compose/services.yml" \
-f "${CONFIG_DIR}/docker-compose.yml" \
"$@"