Skip to content

Commit

Permalink
fix: docker compose check in setup (#7609)
Browse files Browse the repository at this point in the history
* fix: docker compose check in setup

* chore(changelog): add info about issue

* fix: change comment wording
  • Loading branch information
naftis authored Sep 24, 2024
1 parent d51ae6f commit 41a0d29
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@

- Custom form field validators from country config will work offline. [#7478](https://github.com/opencrvs/opencrvs-core/issues/7478)
- Registrar had to retry from outbox every time they corrected a record. [#7583](https://github.com/opencrvs/opencrvs-core/issues/7583)
- Local environment setup command (`bash setup.sh`) could fail in machines that didn't have a unrelated `compose` binary. Fixed to check for Docker Compose. [#7609](https://github.com/opencrvs/opencrvs-core/pull/7609)
- Fix wrong status shown in the Comparison View page of the duplicate record [#7439](https://github.com/opencrvs/opencrvs-core/issues/7439)

### Breaking changes
Expand Down
34 changes: 22 additions & 12 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,7 @@ echo
nvmVersion=$(cat .nvmrc | tr -d '[:space:]')

dependencies=( "docker" "node" "yarn" "tmux")
if [ $OS == "UBUNTU" ]; then
dependencies+=("docker compose")
fi

for i in "${dependencies[@]}"
do
:
Expand All @@ -192,15 +190,7 @@ do
echo "Please follow the documentation here: https://docs.docker.com/desktop/mac/install/"
fi
fi
if [ $i == "docker compose" ] ; then
if [ $OS == "UBUNTU" ]; then
echo "You need to install Docker Compose, or if you did, we can't find it and perhaps it is not in your PATH. Please fix your docker compose installation."
echo "Please follow the documentation here: https://docs.docker.com/compose/install/"
else
echo "You need to install Docker Desktop for Mac, or if you did, we can't find it and perhaps it is not in your PATH. Please fix your docker installation."
echo "Please follow the documentation here: https://docs.docker.com/desktop/mac/install/"
fi
fi

if [ $i == "node" ] ; then
echo "You need to install Node, or if you did, we can't find it and perhaps it is not in your PATH. Please fix your node installation."
echo "We recommend you install Node $nvmVersion as this release has been tested on that version."
Expand Down Expand Up @@ -242,6 +232,26 @@ do
fi
done

###
#
# Check if Docker Compose exists
#
###

if ! docker compose version &> /dev/null
then
echo "Docker Compose is not available in your Docker installation"
echo "Your Docker version may be too old to include Docker Compose as part of the Docker CLI."

if [ $OS == "UBUNTU" ]; then
echo "Please follow the installation instructions here: https://docs.docker.com/engine/install/ubuntu/"
else
echo "Please follow the installation instructions here: https://docs.docker.com/desktop/mac/install/"
fi

exit 1
fi

###
#
# Check Node.js version
Expand Down

0 comments on commit 41a0d29

Please sign in to comment.