diff --git a/templates/deployment.yaml b/templates/deployment.yaml index 40e3475..49a99b4 100644 --- a/templates/deployment.yaml +++ b/templates/deployment.yaml @@ -144,15 +144,15 @@ spec: if [ -z "$TABLES" ]; then echo "=== Starting WordPress Installation ===" - + if [ -z "$WP_ADMIN_PASSWORD" ]; then - WP_ADMIN_PASSWORD=$(tr -dc 'A-Za-z0-9!@#$%^&*' < /dev/urandom | head -c 16) - echo "Generated admin password: $WP_ADMIN_PASSWORD" - echo "$WP_ADMIN_PASSWORD" > /var/www/html/wp-content/.initial-admin-password + echo "ERROR: WP_ADMIN_PASSWORD is not set. WordPress installation requires an admin password." + echo "Skipping WordPress installation. Please set WP_ADMIN_PASSWORD in values.yaml" + exit 1 fi - + INSTALL_URL="http://127.0.0.1" - + echo "Installing WordPress..." /tmp/wp-cli.phar --path=/var/www/html core install \ --url="$INSTALL_URL" \ @@ -161,12 +161,10 @@ spec: --admin_password="$WP_ADMIN_PASSWORD" \ --admin_email="$WP_ADMIN_EMAIL" \ --skip-email - + echo "=== WordPress Installation Completed ===" echo "Admin User: $WP_ADMIN_USER" - if [ -f /var/www/html/wp-content/.initial-admin-password ]; then - echo "Admin Password: $(cat /var/www/html/wp-content/.initial-admin-password)" - fi + echo "Admin password was set from values.yaml" else echo "WordPress is already installed, skipping installation" if [ -f /tmp/wp-cli.phar ]; then