From e7b052a4089d7ffee44ea41a6c6bc5db053b3418 Mon Sep 17 00:00:00 2001 From: pvincent Date: Fri, 3 Apr 2026 22:48:57 +0400 Subject: [PATCH] wordpress poc1 --- recipes/wordpress.recipe | 38 +++++++++++++++++++++++++++++++------- tools/miaou-recipe | 6 +++--- 2 files changed, 34 insertions(+), 10 deletions(-) diff --git a/recipes/wordpress.recipe b/recipes/wordpress.recipe index fdcec74..943775b 100644 --- a/recipes/wordpress.recipe +++ b/recipes/wordpress.recipe @@ -2,20 +2,43 @@ # CONSTANTS -FORCE=${FORCE:-false} +FORCE=false PHP_VERSION=8.4 UPLOAD_MAX_SIZE=2G -WORDPRESS_NAME=reunionbenevolat #TODO: to be personalized +WP_NAME='' # FUNCTIONS +function usage { + echo "$RECIPE_NAME {WP_NAME} [--force|-f]" + echo "install a wordpress" +} + +function parse_options { + while [[ $# -gt 0 ]]; do + case "$1" in + --help | -h) + usage && exit 0 + ;; + --force | -f) + FORCE=true + ;; + *) + if [[ -z $WP_NAME ]]; then + WP_NAME=$1 + else + echo >&2 "Unknown option: $1" && usage && exit 2 + fi + ;; + esac + + shift 1 # Move to the next argument + done + [[ -z $WP_NAME ]] && usage && exit 1 || true +} + function install_mariadb { if $FORCE || ! systemctl is-active mariadb.service --quiet; then - # debconf-set-selections <&2 "Script not found: $SCRIPT" && exit 3 - cat "$SCRIPT" | incus exec "$CONTAINER" -- env FORCE="$FORCE" bash $(debug_option) -s -- "${RECIPE_ARGS[@]}" + local recipe_name=$(basename "$SCRIPT") + cat "$SCRIPT" | incus exec "$CONTAINER" -- env RECIPE_NAME="$recipe_name" bash $(debug_option) -s -- "${RECIPE_ARGS[@]}" } function show_success {