#1: Fix Check & Compose.yaml to be more Specific
Some checks are pending
Quality Check / Check (push) Waiting to run

This commit is contained in:
Snoweuph 2024-04-22 19:30:59 +02:00
parent 620348a305
commit f96c46ff99
Signed by: Snoweuph
GPG key ID: A494330694B208EF
2 changed files with 22 additions and 15 deletions

View file

@ -6,13 +6,7 @@ printf "${BLUE_BG} ${CLEAR}\n"
printf "${BLUE_BG}${BLACK_FG} Checking Requirements ${CLEAR}\n" printf "${BLUE_BG}${BLACK_FG} Checking Requirements ${CLEAR}\n"
printf "${BLUE_BG} ${CLEAR}\n" printf "${BLUE_BG} ${CLEAR}\n"
# Check Symfony CLI
command -v symfony >/dev/null 2>&1 || \
{ \
printf >&2 "${RED_FG}✘ Symfony CLI${YELLOW_FG} is ${RED_FG}not installed${YELLOW_FG}! please install it from:\nhttps://symfony.com/download\n"; \
exit 1; \
}
printf >&2 "${GREEN_FG}✔ Symfony CLI${BLUE_FG} is ${GREEN_FG}installed${BLUE_FG}!\n"
# Check PHP # Check PHP
command -v php >/dev/null 2>&1 || \ command -v php >/dev/null 2>&1 || \
@ -35,9 +29,10 @@ printf >&2 "${GREEN_FG}✔ PHP${BLUE_FG} Version ${GREEN_FG}${current_php_versio
# Check PHP PDO_MYSQL # Check PHP PDO_MYSQL
php -m | grep -i pdo_mysql >/dev/null 2>&1 || \ php -m | grep -i pdo_mysql >/dev/null 2>&1 || \
{ \ { \
printf >&2 "${RED_FG}✘ PHP PDO_MSQL${YELLOW_FG} is ${RED_FG}not installed${YELLOW_FG}!\n"; \ printf >&2 "${RED_FG}✘ PHP PDO_MYSQL${YELLOW_FG} is ${RED_FG}not installed${YELLOW_FG}!\n"; \
exit 1; \ exit 1; \
} }
printf >&2 "${GREEN_FG}✔ PHP MySQL PDO${BLUE_FG} is ${GREEN_FG}installed${BLUE_FG}.\n"
# Check Composer # Check Composer
command -v composer >/dev/null 2>&1 || \ command -v composer >/dev/null 2>&1 || \
@ -47,7 +42,7 @@ command -v composer >/dev/null 2>&1 || \
} }
# Check Composer Version # Check Composer Version
current_composer_version=$(composer --version | awk '{print $3}' | cut -d '.' -f 1) && \ current_composer_version=$(composer --version 2> /dev/null | awk '{print $3}' | cut -d '.' -f 1) && \
[ "${current_composer_version}" = "2" ] || \ [ "${current_composer_version}" = "2" ] || \
{ \ { \
printf >&2 "${RED_FG}✘ Wrong Composer Version${YELLOW_FG} is installed!\n Version ${RED_FG}2${YELLOW_FG} is ${RED_FG}required${YELLOW_FG}.\n"; \ printf >&2 "${RED_FG}✘ Wrong Composer Version${YELLOW_FG} is installed!\n Version ${RED_FG}2${YELLOW_FG} is ${RED_FG}required${YELLOW_FG}.\n"; \
@ -55,6 +50,22 @@ current_composer_version=$(composer --version | awk '{print $3}' | cut -d '.' -f
} && \ } && \
printf >&2 "${GREEN_FG}✔ Composer${BLUE_FG} Version ${GREEN_FG}${current_composer_version}${BLUE_FG} is ${GREEN_FG}installed${BLUE_FG}.\n" printf >&2 "${GREEN_FG}✔ Composer${BLUE_FG} Version ${GREEN_FG}${current_composer_version}${BLUE_FG} is ${GREEN_FG}installed${BLUE_FG}.\n"
# Check Symfony CLI
command -v symfony >/dev/null 2>&1 || \
{ \
printf >&2 "${RED_FG}✘ Symfony CLI${YELLOW_FG} is ${RED_FG}not installed${YELLOW_FG}! please install it from:\nhttps://symfony.com/download\n"; \
exit 1; \
}
printf >&2 "${GREEN_FG}✔ Symfony CLI${BLUE_FG} is ${GREEN_FG}installed${BLUE_FG}!\n"
# Check JQ
command -v jq >/dev/null 2>&1 || \
{ \
printf >&2 "${RED_FG}✘ JQ${YELLOW_FG} is ${RED_FG}not installed${YELLOW_FG}!"; \
exit 1; \
}
printf >&2 "${GREEN_FG}✔ JQ${BLUE_FG} is ${GREEN_FG}installed${BLUE_FG}!\n"
# Check Volta # Check Volta
command -v volta >/dev/null 2>&1 || \ command -v volta >/dev/null 2>&1 || \
{ \ { \
@ -71,7 +82,7 @@ command -v node >/dev/null 2>&1 || \
} }
# Check Node Version # Check Node Version
required_node_version=$(cat package.json | grep -oP '(?<="node": ")([0-9]*)(?=\.[0-9]*\.[0-9]")') && \ required_node_version=$(cat package.json | jq .volta.node | cut -c 2- | cut -d '.' -f 1) && \
current_major_node_version=$(node -v | cut -c 2- | cut -d '.' -f 1) && \ current_major_node_version=$(node -v | cut -c 2- | cut -d '.' -f 1) && \
current_node_version=$(node -v | cut -c 2-) && \ current_node_version=$(node -v | cut -c 2-) && \
[ "${current_major_node_version}" = "${required_node_version}" ] || \ [ "${current_major_node_version}" = "${required_node_version}" ] || \

View file

@ -1,18 +1,14 @@
version: '3' version: '3'
services: services:
###> doctrine/doctrine-bundle ###
database: database:
image: mysql:8.0 image: docker.io/library/mysql:8.0
ports: ports:
- '3306:3306' - '3306:3306'
volumes: volumes:
- 'mysql_data:/var/lib/mysql' - 'mysql_data:/var/lib/mysql'
environment: environment:
MYSQL_ROOT_PASSWORD: 'empty' MYSQL_ROOT_PASSWORD: 'empty'
###< doctrine/doctrine-bundle ###
volumes: volumes:
###> doctrine/doctrine-bundle ###
mysql_data: mysql_data:
###< doctrine/doctrine-bundle ###