From 5ed0838d0259f4df30b01aeb06b48506659729cb Mon Sep 17 00:00:00 2001 From: "Jason A. Cox" Date: Sun, 19 Nov 2023 07:46:32 -0800 Subject: [PATCH 1/2] Add docker-compose warning #386 --- RELEASE.md | 6 ++++++ VERSION | 2 +- compose-dash.sh | 16 +++++++++++++--- upgrade.sh | 2 +- 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index e4d8e6a5..489fe791 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,5 +1,11 @@ # RELEASE NOTES +## v3.0.2 - Docker-Compose Fixes + +* Add future deprecation WARNING for older docker-compose versions. +* Add support for docker-compose >= 1.28.0 to use compose profiles. +* Change logic in `compose-dash.sh` to default to Docker compose V2. + ## v3.0.1 - Fix for Docker-Compose V1 * This fixes an issue introduced by v3.0.0 for old Docker-Compose V1 systems in https://github.com/jasonacox/Powerwall-Dashboard/pull/389 diff --git a/VERSION b/VERSION index cb2b00e4..b5021469 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.0.1 +3.0.2 diff --git a/compose-dash.sh b/compose-dash.sh index 95d563ab..affb53ba 100755 --- a/compose-dash.sh +++ b/compose-dash.sh @@ -79,9 +79,19 @@ if docker compose version > /dev/null 2>&1; then else if docker-compose version > /dev/null 2>&1; then # Build Docker (v1) - pwconfig="powerwall-v1.yml" - if get_profile "solar-only"; then - pwconfig="powerwall-v1-solar.yml" + if docker-compose -f powerwall.yml config > /dev/null 2>&1; then + pwconfig="powerwall.yml" + else + echo "** WARNING **" + echo " You have an old version of docker-compose that will" + echo " be depreciated in a future release. Please upgrade or" + echo " report your use case to the Powerwall-Dashboard project." + echo "" + echo "Applying workaround for old docker-compose..." + pwconfig="powerwall-v1.yml" + if get_profile "solar-only"; then + pwconfig="powerwall-v1-solar.yml" + fi fi docker-compose -f $pwconfig $pwextend $@ else diff --git a/upgrade.sh b/upgrade.sh index 4a3efc24..1577a909 100755 --- a/upgrade.sh +++ b/upgrade.sh @@ -4,7 +4,7 @@ set -e # Set Globals -VERSION="3.0.1" +VERSION="3.0.2" CURRENT="Unknown" COMPOSE_ENV_FILE="compose.env" TELEGRAF_LOCAL="telegraf.local" From 1fb806d5a1cda81ee318fcbc95dd3fc00a8a7d77 Mon Sep 17 00:00:00 2001 From: Michael Birse Date: Mon, 20 Nov 2023 22:03:53 +1100 Subject: [PATCH 2/2] Use variable for compose file references, fix typo --- compose-dash.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/compose-dash.sh b/compose-dash.sh index affb53ba..9e14a2db 100755 --- a/compose-dash.sh +++ b/compose-dash.sh @@ -38,13 +38,13 @@ if ! docker info > /dev/null 2>&1; then fi # Load environment variables for compose -if [ ! -f "compose.env" ]; then - echo "ERROR: Missing compose.env file." - echo "Please run setup.sh or copy compose.env.sample to compose.env." +if [ ! -f ${COMPOSE_ENV_FILE} ]; then + echo "ERROR: Missing ${COMPOSE_ENV_FILE} file." + echo "Please run setup.sh or copy ${COMPOSE_ENV_FILE}.sample to ${COMPOSE_ENV_FILE}." exit 1 fi set -a -. compose.env +. "${COMPOSE_ENV_FILE}" set +a # Docker Compose Extension Check @@ -84,7 +84,7 @@ else else echo "** WARNING **" echo " You have an old version of docker-compose that will" - echo " be depreciated in a future release. Please upgrade or" + echo " be deprecated in a future release. Please upgrade or" echo " report your use case to the Powerwall-Dashboard project." echo "" echo "Applying workaround for old docker-compose..."