From d6e6afe1693072602f1344b8454aa5a225a7572c Mon Sep 17 00:00:00 2001 From: pieter Date: Tue, 25 Nov 2025 14:47:34 +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 | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/templates/deployment.yaml b/templates/deployment.yaml index f13efaf..b23ae61 100644 --- a/templates/deployment.yaml +++ b/templates/deployment.yaml @@ -27,24 +27,25 @@ spec: set -e echo "=== WordPress Initialization Started ===" - echo "Copying WordPress core files to ephemeral storage..." - cp -rp /usr/src/wordpress/* /var/www/html/ - - echo "Removing temporary wp-content from core files..." - rm -rf /var/www/html/wp-content - + echo "Preparing wp-content in persistent storage..." if [ ! -d /var/www/html-persistent/wp-content ]; then echo "Initializing wp-content directory..." mkdir -p /var/www/html-persistent/wp-content cp -rp /usr/src/wordpress/wp-content/* /var/www/html-persistent/wp-content/ + echo "wp-content initialized in persistent storage" else - echo "wp-content already exists, preserving user data" + echo "wp-content already exists in persistent storage, preserving user data" fi + echo "Copying WordPress core files to ephemeral storage (excluding wp-content)..." + cd /usr/src/wordpress + find . -maxdepth 1 ! -name wp-content ! -name . -exec cp -rp {} /var/www/html/ \; + echo "Creating symlink for wp-content..." ln -sf /var/www/html-persistent/wp-content /var/www/html/wp-content - echo "Verifying symlink..." + echo "Verifying directory structure..." + ls -la /var/www/html/ | head -20 ls -la /var/www/html/ | grep wp-content echo "Generating wp-config.php from Secret..."