Browse Source

wordpress poc1

main
pvincent 3 days ago
parent
commit
e7b052a408
  1. 38
      recipes/wordpress.recipe
  2. 6
      tools/miaou-recipe

38
recipes/wordpress.recipe

@ -2,20 +2,43 @@
# CONSTANTS # CONSTANTS
FORCE=${FORCE:-false}
FORCE=false
PHP_VERSION=8.4 PHP_VERSION=8.4
UPLOAD_MAX_SIZE=2G UPLOAD_MAX_SIZE=2G
WORDPRESS_NAME=reunionbenevolat #TODO: to be personalized
WP_NAME=''
# FUNCTIONS # 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 { function install_mariadb {
if $FORCE || ! systemctl is-active mariadb.service --quiet; then if $FORCE || ! systemctl is-active mariadb.service --quiet; then
# debconf-set-selections <<EOF
# postfix postfix/mailname string $(hostname -f)
# postfix postfix/main_mailer_type string 'Internet Site'
# postfix postfix/mynetworks string '127.0.0.0/8'
# EOF
DEBIAN_FRONTEND=noninteractive apt-get install -y mariadb-server DEBIAN_FRONTEND=noninteractive apt-get install -y mariadb-server
echo mariadb installed successfully! echo mariadb installed successfully!
else else
@ -89,6 +112,7 @@ EOF
# MAIN # MAIN
parse_options "$@"
install_mariadb install_mariadb
install_php install_php
# install_wordpress # install_wordpress

6
tools/miaou-recipe

@ -4,10 +4,9 @@
BASEDIR=$(dirname "$0") BASEDIR=$(dirname "$0")
CONTAINER=${CONTAINER:-} CONTAINER=${CONTAINER:-}
SCRIPT=''
SCRIPT=
DEBUG=false DEBUG=false
QUIET=false QUIET=false
FORCE=${FORCE:-false}
RECIPE_ARGS=() RECIPE_ARGS=()
# FUNCTIONS # FUNCTIONS
@ -60,7 +59,8 @@ function debug_option {
function recipe { function recipe {
[[ ! -f $SCRIPT ]] && echo >&2 "Script not found: $SCRIPT" && exit 3 [[ ! -f $SCRIPT ]] && echo >&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 { function show_success {

Loading…
Cancel
Save