From 7e0b839093f9d02fad38d2ecc94cb6d0b5ee833f Mon Sep 17 00:00:00 2001 From: pieter Date: Fri, 12 Dec 2025 23:01:54 +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 | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/templates/deployment.yaml b/templates/deployment.yaml index 31d7393..14105f4 100644 --- a/templates/deployment.yaml +++ b/templates/deployment.yaml @@ -159,12 +159,6 @@ spec: /tmp/wp-cli.phar --path=/var/www/html core update-db 2>/dev/null || echo "No database update needed" fi fi - {{- if .Values.wordpress.adsTxt.enabled }} - - echo "Deploying ads.txt..." - printf '%s\n' '{{ .Values.wordpress.adsTxt.content }}' > /var/www/html/ads.txt - echo "ads.txt deployed" - {{- end }} echo "=== WordPress Initialization Completed ===" volumeMounts: @@ -262,6 +256,11 @@ spec: - name: nginx-config mountPath: /etc/nginx/conf.d/default.conf subPath: default.conf + {{- if .Values.wordpress.adsTxt.enabled }} + - name: adstxt-config + mountPath: /var/www/html/ads.txt + subPath: ads.txt + {{- end }} {{- if .Values.healthCheck.enabled }} livenessProbe: {{- toYaml .Values.healthCheck.livenessProbe | nindent 12 }} @@ -311,6 +310,11 @@ spec: - name: nginx-config configMap: name: {{ include "wordpress-nginx.fullname" . }}-nginx-config + {{- if .Values.wordpress.adsTxt.enabled }} + - name: adstxt-config + configMap: + name: {{ include "wordpress-nginx.fullname" . }}-adstxt + {{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }}