Docker-Swarm-Loadbalancer/php/core/install-report.sh
Matthew Baggett 6db6395f66
Trunk linter ()
* linting is fun

* mis-detection of missing healthcheck staements.

* typo

* disable tagging vanity tags on non-main branch

* Unbugger node build?

* Add gitleaks detector, remove an expired secret.

* More linting-derived cleanup

* Fiddle with trivy

* Fiddle with trivy

* add a readme

* Fix build bug with php flavours

* Marshall should build other flavours of ubuntu.

* Fiddle with act cache location.

* Add concurrency checks

* Composer version gubbins for 7.0/7.1

* ubuntu is just a label, and injected over the top of.

* Composer version gubbins for 7.0/7.1

* Run when workflow is altered too please.

* Hopefully fix composer stage.

* setup tooling meta-tooling.

* Add trunk

* Disable mirror mode, its being problematic, and increase retries to 5.

* Revisit how ghcr login works.

* Add trunk checks.

* All hail the linter

* Heavilly revise workflow

* Fettling

* Fettling

* Fettling

* Fettling

* Fettling

* Cleanup

* Cleanup

* Fettling.. Why does mitm build but not redis?

* Fettling.. Why does mitm build but not redis?

* Debuggin

* Fettling.

* Fix build?

* Permissions are a pain

* Switch around some should_push logic because envs aren't available that early.

* Permissionssssss

* Trivy, bane of my life

* Fix merge?

* Fix labels

* Help node along, among other things

* Redis 6.1 & 7.1 aren't a thing any more.

* Ffff USER nonsense

* latest-openssl doesn't exist.

* fixup mysqlproxy.

* Fix labels

* uurrgh

* uurrgh

* Didn't need to add the mitmproxy user, it exists

* Missing ghcr login

* Missing backtick

* Fix build?

* Add validate build step to bouncer.

* Fix bouncer build

* Disable laravel build

* Missing env

* Fix swarm mon build

* Scout just doesn't seem to work.
2024-02-07 16:21:14 +01:00

44 lines
2.1 KiB
Bash

#!/bin/bash
# shellcheck disable=SC1091,SC2312
source /usr/local/lib/marshall_installer
printf "Executing: %b%s%b\n" "${COLOUR_SUCCESS}" "Install Report" "${COLOUR_RESET}"
PHP_VERSION=$(/usr/bin/php --version | head -n 1 | cut -f2 -d' ' | cut -f1 -d'-')
COMPOSER_VERSION=$(/usr/local/bin/composer --version | cut -f3 -d' ')
GIT_VERSION=$(git --version | sed 's|git version ||')
PROJECT_CODE_SIZE=$(du -cBM /app | grep total | cut -f1)
PROJECT_CODE_SIZE_BYTES=$(du -c /app | grep total | cut -f1)
PHP_MODULES=$(/usr/bin/php -m)
MAX_CODE_SIZE_BYTES=100000000
MODULES_COLUMNS=6
[[ ${PROJECT_CODE_SIZE_BYTES} -gt ${MAX_CODE_SIZE_BYTES} ]] && COLOUR_CODE_SIZE="${COLOUR_FAIL}" || COLOUR_CODE_SIZE="${COLOUR_SUCCESS}"
MODULES=("SimpleXML" "dom" "mcrypt" "sodium" "Reflection" "xml" "xsl" "Xdebug" "PDO" "pdo_mysql" "pdo_pgsql" "pdo_sqlite" "mysqlnd" "mysqli" "pgsql" "sqlite3" "tokenizer" "bz2" "zip" "zlib" "apcu" "redis" "mongodb" "memcached" "gd" "exif" "imap" "bcmath" "intl" "json" "ldap" "mbstring" "curl" "soap")
echo -e "Ubuntu Version installed: ${COLOUR_BRIGHT_BLUE}${UBUNTU_VERSION}${COLOUR_RESET}"
echo -e "PHP Version installed: ${COLOUR_BRIGHT_BLUE}${PHP_VERSION}${COLOUR_RESET}"
echo -e "Composer Version installed: ${COLOUR_BRIGHT_BLUE}${COMPOSER_VERSION}${COLOUR_RESET}"
echo -e "Git Version installed: ${COLOUR_BRIGHT_BLUE}${GIT_VERSION}${COLOUR_RESET}"
echo -e "Application Size: ${COLOUR_CODE_SIZE}${PROJECT_CODE_SIZE}${COLOUR_RESET}"
echo -e "PHP Modules installed:"
i=1
for module in "${MODULES[@]}"; do
(
[[ ${PHP_MODULES} =~ ${module} ]] &&
printf "%b%s%b %-14s " "${COLOUR_SUCCESS}" "✓" "${COLOUR_RESET}" "${module}" ||
printf "%b%s%b %-14s " "${COLOUR_FAIL}" "✕" "${COLOUR_RESET}" "${module}"
)
if ! ((i % MODULES_COLUMNS)); then
echo ""
fi
i=$((i + 1))
done
echo
# @todo This bombs out if it can't read from a restricted repo. Revise later.
#if [ -f /app/composer.json ]; then
# if [ -f /app/composer.lock ]; then
# echo -e "Outdated ${COLOUR_FAIL}Composer${COLOUR_NONE} packages:"
# /usr/local/bin/composer outdated
# fi
#fi