Allow a config only option for start script

This commit is contained in:
Nicolas Meienberger 2022-05-17 23:55:24 +02:00
parent 37fa0ec0ec
commit 29b3d35b1c

View file

@ -8,6 +8,8 @@ else
readlink=readlink
fi
config_only="$1"
ROOT_FOLDER="$($readlink -f $(dirname "${BASH_SOURCE[0]}")/..)"
STATE_FOLDER="${ROOT_FOLDER}/state"
SED_ROOT_FOLDER="$(echo $ROOT_FOLDER | sed 's/\//\\\//g')"
@ -16,6 +18,8 @@ DNS_IP=9.9.9.9 # Default to Quad9 DNS
USERNAME="$(id -nu 1000)"
ARCHITECTURE="$(uname -m)"
if [[ "$architecture" == "aarch64" ]]; then
ARCHITECTURE="arm64"
fi
@ -123,12 +127,15 @@ bash "${ROOT_FOLDER}/scripts/system-info.sh"
# ansible-playbook ansible/start.yml -i ansible/hosts -K -e username="$USERNAME"
docker-compose --env-file "${ROOT_FOLDER}/.env" pull
# Run docker-compose
docker-compose --env-file "${ROOT_FOLDER}/.env" up --detach --remove-orphans --build || {
echo "Failed to start containers"
exit 1
}
## Don't run if config-only
if [[ ! "$config_only" == "true" ]]; then
docker-compose --env-file "${ROOT_FOLDER}/.env" pull
# Run docker-compose
docker-compose --env-file "${ROOT_FOLDER}/.env" up --detach --remove-orphans --build || {
echo "Failed to start containers"
exit 1
}
fi
# str=$(get_json_field ${STATE_FOLDER}/apps.json installed)
# apps_to_start=($str)