This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PROJECT_NAME="gameofthrones" | |
CURRENT_DOCKER_COMPOSE_VERSION=$( docker-compose -v | grep -o '[0-9]*[.][0-9]*[.][0-9]' | sed -e 's/[.]//g' ) | |
BREAKING_DOCKER_COMPOSE_VERSION=1210 | |
# Since docker compose version: '1.21.0', the network setup automatically adds a single '_' to the project_name, | |
# while version '1.20.0' and below replaces any extra ‘_’ at the end of the project_name with a single '_'. | |
# This assumes that at versions below '1.20.0' e.g. '1.9.0', no ‘_’ is added at the end of the project_name. | |
if [[ ${CURRENT_DOCKER_COMPOSE_VERSION} -lt ${BREAKING_DOCKER_COMPOSE_VERSION} ]]; then | |
PROJECT_NAME="${PROJECT_NAME}_" |