1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-26 20:54:21 +01:00

(bug) fix #355 compatibility with the new docker-compose CLI

This commit is contained in:
Sylvain 2022-05-23 16:29:10 +02:00
parent dce1835028
commit f2cef4387e
5 changed files with 65 additions and 2 deletions

View File

@ -10,6 +10,7 @@
- Fix a bug: Missing of description of PlanCategory migration
- Fix a bug: Unable to create plans for all group
- Fix a bug: backPrevLocation button on Notification Center opens reset password page (#348)
- Fix a bug: compatibility with the new docker-compose CLI (#355)
- Fix a security issue: updated moment.js to 2.29.2. to fix [CVE-2022-24785](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-24785)
- Fix a security issue: updated nokogiri to 1.13.6 to fix [CVE-2022-298240](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-298240)
- Fix a security issue: updated async to 2.6.4 to fix [CVE-2021-43138](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-43138)

View File

@ -1,3 +1,18 @@
#!/usr/bin/env bash
docker-compose()
{
if ! docker compose version 1>/dev/null 2>/dev/null
then
if ! \docker-compose version 1>/dev/null 2>/dev/null
then
echo -e "\e[91m[ ❌ ] docker-compose was not found, exiting...\e[39m" && exit 1
else
\docker-compose "$@"
fi
else
docker compose "$@"
fi
}
docker-compose exec -T postgres psql -Upostgres -c \\dFd | head -n -2 | tail -n +3 | awk '{ print gensub(/([a-z]+)_stem/,"\\1","g",$3); }'

View File

@ -8,6 +8,21 @@ config() {
SERVICE="$(yq eval '.services.*.image | select(. == "sleede/fab-manager*") | path | .[-2]' docker-compose.yml)"
}
docker-compose()
{
if ! docker compose version 1>/dev/null 2>/dev/null
then
if ! \docker-compose version 1>/dev/null 2>/dev/null
then
echo -e "\e[91m[ ❌ ] docker-compose was not found, exiting...\e[39m" && exit 1
else
\docker-compose "$@"
fi
else
docker compose "$@"
fi
}
run()
{
config

View File

@ -45,7 +45,7 @@ system_requirements()
fi
done
fi
local _commands=("sudo" "curl" "sed" "openssl" "docker" "docker-compose" "systemctl")
local _commands=("sudo" "curl" "sed" "openssl" "docker" "systemctl")
for _command in "${_commands[@]}"; do
echo "detecting $_command..."
if ! command -v "$_command"
@ -54,9 +54,26 @@ system_requirements()
echo -e "\e[91m[ ❌ ] $_command was not found, exiting...\e[39m" && exit 1
fi
done
echo "detecting docker-compose..."
docker-compose version
printf "\e[92m[ ✔ ] All requirements successfully checked.\e[39m \n\n"
}
docker-compose()
{
if ! docker compose version 1>/dev/null 2>/dev/null
then
if ! \docker-compose version 1>/dev/null 2>/dev/null
then
echo -e "\e[91m[ ❌ ] docker-compose was not found, exiting...\e[39m" && exit 1
else
\docker-compose "$@"
fi
else
docker compose "$@"
fi
}
is_root()
{
return $(id -u)

View File

@ -43,6 +43,21 @@ jq() {
docker run --rm -i -v "${PWD}:/data" imega/jq "$@"
}
docker-compose()
{
if ! docker compose version 1>/dev/null 2>/dev/null
then
if ! \docker-compose version 1>/dev/null 2>/dev/null
then
echo -e "\e[91m[ ❌ ] docker-compose was not found, exiting...\e[39m" && exit 1
else
\docker-compose "$@"
fi
else
docker compose "$@"
fi
}
# set $SERVICE and $YES_ALL
config()
{