Skip to content

Commit

Permalink
Fix the compose version detection
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitamendelbaum committed Jul 25, 2024
1 parent aac8d80 commit 794b342
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 25 deletions.
1 change: 1 addition & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
STRATO versions supported: v11.3.1+

- Added the `notification-server` script
- Fixed the error with detecting the Compose version in utility server scripts

## 4.5.0

Expand Down
6 changes: 3 additions & 3 deletions highway
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,16 @@ then
exit 1
fi

if ! docker-compose -v &> /dev/null
if ! docker compose version &> /dev/null && ! docker-compose -v &> /dev/null
then
echo -e "${Red}Error: docker-compose is required: https://docs.docker.com/compose/install/"
echo -e "${Red}Error: Docker Compose is required: https://docs.docker.com/compose/install/"
exit 2
else
if ! docker compose version &> /dev/null
then
docker_compose="docker-compose -p highway -f docker-compose.highway.yml --log-level ERROR"
else
docker_compose="docker compose -p highway -f docker-compose.highway.yml"
docker_compose="docker -l error compose -p highway -f docker-compose.highway.yml"
fi
fi

Expand Down
6 changes: 3 additions & 3 deletions identity
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,16 @@ then
exit 1
fi

if ! docker-compose -v &> /dev/null
if ! docker compose version &> /dev/null && ! docker-compose -v &> /dev/null
then
echo -e "${Red}Error: docker-compose is required: https://docs.docker.com/compose/install/"
echo -e "${Red}Error: Docker Compose is required: https://docs.docker.com/compose/install/"
exit 2
else
if ! docker compose version &> /dev/null
then
docker_compose="docker-compose -p identity -f docker-compose.identity.yml --log-level ERROR"
else
docker_compose="docker compose -p identity -f docker-compose.identity.yml"
docker_compose="docker -l error compose -p identity -f docker-compose.identity.yml"
fi
fi

Expand Down
6 changes: 3 additions & 3 deletions notification-server
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,16 @@ then
exit 1
fi

if ! docker-compose -v &> /dev/null
if ! docker compose version &> /dev/null && ! docker-compose -v &> /dev/null
then
echo -e "${Red}Error: docker-compose is required: https://docs.docker.com/compose/install/"
echo -e "${Red}Error: Docker Compose is required: https://docs.docker.com/compose/install/"
exit 2
else
if ! docker compose version &> /dev/null
then
docker_compose="docker-compose -p notification-server -f docker-compose.notification.yml --log-level ERROR"
else
docker_compose="docker compose -p notification-server -f docker-compose.notification.yml"
docker_compose="docker -l error compose -p notification-server -f docker-compose.notification.yml"
fi
fi

Expand Down
6 changes: 3 additions & 3 deletions payment-server
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,16 @@ then
exit 1
fi

if ! docker-compose -v &> /dev/null
if ! docker compose version &> /dev/null && ! docker-compose -v &> /dev/null
then
echo -e "${Red}Error: docker-compose is required: https://docs.docker.com/compose/install/"
echo -e "${Red}Error: Docker Compose is required: https://docs.docker.com/compose/install/"
exit 2
else
if ! docker compose version &> /dev/null
then
docker_compose="docker-compose -p payment-server -f docker-compose.payment.yml --log-level ERROR"
else
docker_compose="docker compose -p payment-server -f docker-compose.payment.yml"
docker_compose="docker -l error compose -p payment-server -f docker-compose.payment.yml"
fi
fi

Expand Down
11 changes: 1 addition & 10 deletions strato
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ fi

if ! docker compose version &> /dev/null && ! docker-compose -v &> /dev/null
then
echo -e "${Red}Error: docker-compose is required: https://docs.docker.com/compose/install/"
echo -e "${Red}Error: Docker Compose is required: https://docs.docker.com/compose/install/"
exit 2
else
if ! docker compose version &> /dev/null
Expand Down Expand Up @@ -336,15 +336,6 @@ then
export isRootNode=true
# Generate random networkID if not provided for --single mode
export networkID=${networkID:-$(($RANDOM * $RANDOM * $RANDOM))}
# TODO: Update and re-enable the in-place single node restart process
#if [[ $(docker ps -a | grep strato${CNAME_SEP}strato${CNAME_SEP}1) ]]; then
# echo -e "${BYellow}Updating the existing STRATO Single node instance - getting it's blockstanbul variables...${NC}"
# STRATO_ENV_VARS=$(docker inspect --format='{{range .Config.Env}}{{println .}}{{end}}' strato${CNAME_SEP}strato${CNAME_SEP}1)
# export blockstanbulAdmins=$(echo "${STRATO_ENV_VARS}" | grep blockstanbulAdmins | awk -F"ulAdmins=" '{print $2}')
# export validators=$(echo "${STRATO_ENV_VARS}" | grep validators | awk -F"alidators=" '{print $2}')
# export generateKey=false
#fi
else
if [[ ${generateKey} = false ]]; then
Expand Down
6 changes: 3 additions & 3 deletions vault
Original file line number Diff line number Diff line change
Expand Up @@ -123,17 +123,17 @@ then
exit 1
fi

if ! docker-compose -v &> /dev/null
if ! docker compose version &> /dev/null && ! docker-compose -v &> /dev/null
then
echo -e "${Red}Error: docker-compose is required: https://docs.docker.com/compose/install/"
echo -e "${Red}Error: Docker Compose is required: https://docs.docker.com/compose/install/"
exit 2
else
if ! docker compose version &> /dev/null
then
docker_compose="docker-compose -p vault -f docker-compose.vault.yml --log-level ERROR"
CNAME_SEP="_"
else
docker_compose="docker compose -p vault -f docker-compose.vault.yml"
docker_compose="docker -l error compose -p vault -f docker-compose.vault.yml"
CNAME_SEP="-"
fi
fi
Expand Down

0 comments on commit 794b342

Please sign in to comment.