check version docker-compose in install script

pull/447/head
OscarSotoSanchez 2020-04-24 12:47:24 +02:00
parent 797732f244
commit f73c682903
1 changed files with 8 additions and 4 deletions

View File

@ -4,16 +4,20 @@ OPENVIDU_FOLDER=openvidu
OPENVIDU_VERSION=master
# Check docker and docker-compose installation
docker -v > /dev/null 2>&1
if [ $? -ne 0 ]; then
if ! command -v docker > /dev/null; then
echo "You don't have docker installed, please install it and re-run the command"
exit 0
fi
docker-compose -v > /dev/null 2>&1
if [ $? -ne 0 ]; then
if ! command -v docker-compose > /dev/null; then
echo "You don't have docker-compose installed, please install it and re-run the command"
exit 0
else
COMPOSE_VERSION=$(docker-compose version --short | sed "s/-rc[0-9]*//")
if ! printf '%s\n%s\n' "1.24" "$COMPOSE_VERSION" | sort -V -C; then
echo "You need a docker-compose version equal or higher than 1.24, please update your docker-compose and re-run the command"; \
exit 0
fi
fi
# Create folder openvidu-docker-compose