Skip to content

Commit

Permalink
fix(#8781): docker helper to use docker compose v2x (#9309)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjones-plip authored and sugat009 committed Aug 12, 2024
1 parent 710d0a8 commit 02fe538
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions scripts/docker-helper-4.x/cht-docker-compose.sh
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,16 @@ required_apps_installed(){
echo "${error}"
}

docker_not_installed(){
# special check for docker. We want to be sure both "docker" is installed AND
# that "docker compose" is installed. We deprecated "docker-compose" in CHT Core #8781
if [ -n "$(required_apps_installed "docker")" ];then
echo "Docker not installed"
else
docker compose &>/dev/null || echo "Docker Compose not installed"
fi
}

get_nginx_container_id() {
docker ps --all --filter "publish=${NGINX_HTTPS_PORT}" --filter "name=${projectName}" --quiet 2>/dev/null
}
Expand Down Expand Up @@ -256,9 +266,9 @@ get_system_and_docker_info(){
echo $"$info" | column -t
}

if [ -n "$(required_apps_installed "docker-compose")" ];then
if [ "$(docker_not_installed)" ];then
echo ""
echo -e "${red}\"docker-compose\" is not installed or could not be found. Please install and try again!${noColor}"
echo -e "${red}\"docker\" or \"docker compose\" is not installed or could not be found. Please install and try again!${noColor}"
show_help_existing_stop_and_destroy
exit 0
fi
Expand Down Expand Up @@ -421,7 +431,7 @@ projectURL=$(get_local_ip_url "$(get_lan_ip)")
if [[ -n ${DEBUG+x} ]];then get_system_and_docker_info; fi

echo "";echo "homedir: $homeDir"
docker-compose --env-file "./$projectFile" --file "$homeDir/upgrade-service.yml" up --detach
docker compose --env-file "./$projectFile" --file "$homeDir/upgrade-service.yml" up --detach
if [[ -n ${DEBUG+x} ]];then get_system_and_docker_info; fi

set +e
Expand Down

0 comments on commit 02fe538

Please sign in to comment.