templates/deployment.yaml を更新

This commit is contained in:
2025-11-25 14:47:34 +00:00
parent 13b84799d5
commit d6e6afe169

View File

@@ -27,24 +27,25 @@ spec:
set -e set -e
echo "=== WordPress Initialization Started ===" echo "=== WordPress Initialization Started ==="
echo "Copying WordPress core files to ephemeral storage..." echo "Preparing wp-content in persistent storage..."
cp -rp /usr/src/wordpress/* /var/www/html/
echo "Removing temporary wp-content from core files..."
rm -rf /var/www/html/wp-content
if [ ! -d /var/www/html-persistent/wp-content ]; then if [ ! -d /var/www/html-persistent/wp-content ]; then
echo "Initializing wp-content directory..." echo "Initializing wp-content directory..."
mkdir -p /var/www/html-persistent/wp-content mkdir -p /var/www/html-persistent/wp-content
cp -rp /usr/src/wordpress/wp-content/* /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 else
echo "wp-content already exists, preserving user data" echo "wp-content already exists in persistent storage, preserving user data"
fi 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..." echo "Creating symlink for wp-content..."
ln -sf /var/www/html-persistent/wp-content /var/www/html/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 ls -la /var/www/html/ | grep wp-content
echo "Generating wp-config.php from Secret..." echo "Generating wp-config.php from Secret..."