Check docker-compose version
Signed-off-by: Simó Albert i Beltran <sim6@bona.gent>
parent
94babbd403
commit
6a84016f7a
20
dd-ctl
20
dd-ctl
|
@ -2,6 +2,21 @@
|
|||
|
||||
OPERATION="$1"
|
||||
|
||||
# We need docker-compose >= 1.28 to catch configuration variables
|
||||
REQUIRED_DOCKER_COMPOSE_VERSION="1.28"
|
||||
|
||||
docker_compose_version(){
|
||||
docker-compose --version --short | sed 's/^docker-compose version \([^,]\+\),.*$/\1/'
|
||||
}
|
||||
|
||||
check_docker_compose_version(){
|
||||
# We cannot use sort -C because is not included in BusyBox v1.33.1 of docker:dind image
|
||||
{
|
||||
echo "$REQUIRED_DOCKER_COMPOSE_VERSION"
|
||||
docker_compose_version
|
||||
} | sort -c -V 2> /dev/null
|
||||
}
|
||||
|
||||
help() {
|
||||
cat <<-EOF
|
||||
Example: ./dd.ctl [operation] [arguments]
|
||||
|
@ -51,6 +66,11 @@ if [ "$OPERATION" != "prerequisites" ]; then
|
|||
echo "You need to copy digitaldemocratic.conf.sample to digitaldemocratic.conf and adapt"
|
||||
exit 1
|
||||
fi
|
||||
if ! check_docker_compose_version
|
||||
then
|
||||
echo "ERROR: Please use docker-compose greather than or equal to $REQUIRED_DOCKER_COMPOSE_VERSION." >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
BRANCH="${2:-master}"
|
||||
|
|
Loading…
Reference in New Issue