Docs: Show available tools per version in README.md

This commit is contained in:
cytopia 2022-12-31 05:26:19 +01:00
parent 448054bece
commit 894706ab09
No known key found for this signature in database
GPG Key ID: 6D56EDB8695128A2
3 changed files with 38 additions and 2 deletions

View File

@ -6,12 +6,24 @@ endif
# -------------------------------------------------------------------------------------------------
# Misc Targets
# -------------------------------------------------------------------------------------------------
update-readme:
.PHONY: update-readme
update-readme: _update-readme-modules
update-readme: _update-readme-tools
.PHONY: _update-readme-modules
_update-readme-modules:
cat "../README.md" \
| perl -0 -pe "s#<!-- modules -->.*<!-- /modules -->#<!-- modules -->\n$$(./scripts/get-modules.sh)\n<!-- /modules -->#s" \
> "../README.md.tmp"
yes | mv -f "../README.md.tmp" "../README.md"
.PHONY: _update-readme-tools
_update-readme-tools:
cat "../README.md" \
| perl -0 -pe "s#<!-- tools -->.*<!-- /tools -->#<!-- tools -->\n$$(./scripts/get-tools.sh)\n<!-- /tools -->#s" \
> "../README.md.tmp"
yes | mv -f "../README.md.tmp" "../README.md"
# -------------------------------------------------------------------------------------------------
# Linting Targets

25
.tests/scripts/get-tools.sh Executable file
View File

@ -0,0 +1,25 @@
#!/usr/bin/env bash
# NOTE: Parsing curl to tac to circumnvent "failed writing body"
# https://stackoverflow.com/questions/16703647/why-curl-return-and-error-23-failed-writing-body
set -e
set -u
set -o pipefail
SCRIPT_PATH="$( cd "$(dirname "$0")" && pwd -P )"
DVLBOX_PATH="$( cd "${SCRIPT_PATH}/../.." && pwd -P )"
# shellcheck disable=SC1090
. "${SCRIPT_PATH}/.lib.sh"
RETRIES=10
# -------------------------------------------------------------------------------------------------
# FUNCTIONS
# -------------------------------------------------------------------------------------------------
PHP_TAG="$( grep 'devilbox/php' "${DVLBOX_PATH}/docker-compose.yml" | sed 's/^.*-work-//g' )"
PHP_TOOLS="$( run "curl -sS 'https://raw.githubusercontent.com/devilbox/docker-php-fpm/${PHP_TAG}/doc/available-tools.md'" "${RETRIES}" )";
echo "${PHP_TOOLS}" | grep -A 1000000 'TOOLS_WORK_START'

View File

@ -68,7 +68,6 @@ The Devilbox runs on all major operating systems and its only requirement is <co
* [Docker Compose 1.16.0+](https://docs.docker.com/compose/compose-file/compose-versioning/#version-23)
</details>
<br/>
Be up and running in 2 minutes.
<details style="margin-bottom:0px !important;"><summary>🚀 Install and Run: Linux</summary>