From dc8cf4f6f2283820e9eddb37a48339a87e0be515 Mon Sep 17 00:00:00 2001 From: pieter Date: Fri, 12 Dec 2025 00:14:57 +0000 Subject: [PATCH] =?UTF-8?q?templates/deployment.yaml=20=E3=82=92=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/deployment.yaml | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/templates/deployment.yaml b/templates/deployment.yaml index 177d73d..8f367cf 100644 --- a/templates/deployment.yaml +++ b/templates/deployment.yaml @@ -165,13 +165,20 @@ spec: echo "WordPress is already installed, skipping installation" fi - {{- if .Values.wordpress.adsTxt.enabled }} - echo "Deploying ads.txt..." - cat > /var/www/html/ads.txt <<'ADSTXT' + if [ ! -z "$TABLES" ]; then + echo "Running WordPress core update check..." + CURRENT_VERSION=$(cat /usr/src/wordpress/wp-includes/version.php | grep "wp_version = " | cut -d "'" -f 2 || echo "unknown") + echo "Target WordPress version: $CURRENT_VERSION" + /tmp/wp-cli.phar --path=/var/www/html core update-db 2>/dev/null || echo "No database update needed" + fi + + if [ "${{ .Values.wordpress.adsTxt.enabled }}" = "true" ]; then + echo "Deploying ads.txt..." + cat > /var/www/html/ads.txt <<'ADSTXTEOF' {{ .Values.wordpress.adsTxt.content }} -ADSTXT - echo "ads.txt deployed" - {{- end }} +ADSTXTEOF + echo "ads.txt deployed" + fi echo "=== WordPress Initialization Completed ===" volumeMounts: