This commit is contained in:
2024-05-17 11:37:51 +02:00
parent 90d1c5fd66
commit 6ffac4ac92
2 changed files with 48 additions and 0 deletions

View File

@@ -122,10 +122,18 @@ options:
admin_name: wordpress_admin
is_debug: false
locale: fr_FR
locales: fr_FR en_US
plugins: ''
theme: ''
themes: ''
examples:
- admin_name: wordpress_admin
is_debug: false
locale: fr_FR
locales: fr_FR en_US
plugins: ''
theme: ''
themes: ''
properties:
admin_name:
default: wordpress_admin
@@ -136,6 +144,18 @@ options:
locale:
default: fr_FR
type: string
locales:
default: fr_FR en_US
type: string
plugins:
default: ''
type: string
theme:
default: ''
type: string
themes:
default: ''
type: string
type: object
domain:
default: your-company

View File

@@ -15,6 +15,11 @@ resource "kubectl_manifest" "wordpress_cfg" {
WORDPRESS_TITLE: "${var.instance}"
WORDPRESS_TABLE_PREFIX: wp_
WORDPRESS_DEBUG: "${var.config.is_debug?"true":""}"
WORDPRESS_PLUGINS: "${var.config.plugins}"
WORDPRESS_THEMES: "${var.config.themes}"
WORDPRESS_THEME: "${var.config.theme}"
WORDPRESS_LOCALES: "${var.config.locales}"
WORDPRESS_LOCALE: "${var.config.locale}"
WORDPRESS_CONFIG_EXTRA: |
#### general settings
define('WP_HOME', 'https://${local.dns_name}');
@@ -50,6 +55,29 @@ resource "kubectl_manifest" "wordpress_files" {
if [ -z "$(wp core is-installed)" ]; then
wp core install --url="https://$${WORDPRESS_HOST}" --title="$${WORDPRESS_TITLE}" --admin_user="$${WORDPRESS_ADMIN_NAME}" --admin_password="$${WORDPRESS_ADMIN_PASSWORD}" --admin_email="$${WORDPRESS_ADMIN_MAIL}" --locale="${var.config.locale}" --skip-email
fi
for THEME in $(echo "$WORDPRESS_THEMES"|sed 's/;/ /g;s/,/ /g');do
wp theme install $THEME
done
if [ ! -z "$WORDPRESS_THEME" ]; then
wp theme install $WORDPRESS_THEME
wp theme activate $WORDPRESS_THEME
fi
for PLUGIN in $(echo "miniorange-login-with-eve-online-google-facebook $WORDPRESS_PLUGINS"|sed 's/;/ /g;s/,/ /g');do
wp plugin install $PLUGIN
wp plugin activate $PLUGIN
done
for LOCALE in $(echo "$WORDPRESS_LOCALES"|sed 's/;/ /g;s/,/ /g');do
wp language core install $LOCALE
wp language theme install --all $LOCALE
wp language plugin install --all $LOCALE
done
if [ ! -z "$WORDPRESS_LOCALE" ]; then
wp language core install $WORDPRESS_LOCALE
wp language theme install --all $WORDPRESS_LOCALE
wp language plugin install --all $WORDPRESS_LOCALE
wp language core activate $WORDPRESS_LOCALE
fi
wp core update-db
wp-cli: |-
#!/bin/sh
WP_PATH=/var/www/html/