From 7717fcf3447c8f6c64d04b30b1373fbd81825469 Mon Sep 17 00:00:00 2001 From: Felix Bartels Date: Mon, 2 Sep 2019 12:30:52 +0200 Subject: [PATCH] add functionality to detect the grapi version this allows running the same dockerfile with both master and final branches of Kopano Groupware Core Signed-off-by: Felix Bartels (cherry picked from commit a40db475f92eb9908348871ccd4b40f24161de66) --- core/start-service.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/start-service.sh b/core/start-service.sh index 7e8111c..4670563 100755 --- a/core/start-service.sh +++ b/core/start-service.sh @@ -96,7 +96,13 @@ grapi) esac # cleaning up env variables unset "${!KCCONF_@}" - exec kopano-grapi serve --backend="$GRAPI_BACKEND" + # the backend option is only available in more recent versions of grapi + grapiversion=$(dpkg-query --showformat='${Version}' --show kopano-grapi) + if dpkg --compare-versions "$grapiversion" "gt" "10.0.0"; then + exec kopano-grapi serve --backend="$GRAPI_BACKEND" + else + exec kopano-grapi serve + fi ;; kapi) if [ "$KCCONF_KAPID_INSECURE" = "yes" ]; then