[bitnami/wordpress] Enable using the bitnami/wordpress container custom user post-init.d scripts (#4373)

* Added Custom post-init scripts configmap to wordpress helm chart

* Corrected variable name in example

* Bump wordpress chart version

* Remove empty spaces

* Add newline at the end of values.yaml

* Bumped minor chart version

* Added more explicit empty map as default value to customPostInitScripts

* Added same default values to values-production.yaml

* Shortened configmap name and swapped templating function that populates data field

* Added newline at the end of values.production.yaml

* Update values-production.yaml

Co-authored-by: Bogdan Peste <Bogdan.Peste@ibm.com>
Co-authored-by: Miguel Ángel Cabrera Miñagorri <devgorri@gmail.com>
This commit is contained in:
Bogdan Peste
2020-11-18 16:00:03 +02:00
committed by GitHub
parent b743bf60c7
commit 5c938a194f
4 changed files with 49 additions and 1 deletions

View File

@@ -1,6 +1,6 @@
apiVersion: v1
name: wordpress
version: 9.9.3
version: 9.10.0
appVersion: 5.5.3
description: Web publishing platform for building blogs and websites.
icon: https://bitnami.com/assets/stacks/wordpress/img/wordpress-stack-220x234.png

View File

@@ -0,0 +1,8 @@
{{- if .Values.customPostInitScripts }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "wordpress.fullname" . }}-postinit
data:
{{- include "wordpress.tplValue" ( dict "value" .Values.customPostInitScripts "context" $ ) | nindent 2 }}
{{- end }}

View File

@@ -576,3 +576,23 @@ sidecars: {}
## command: ['sh', '-c', 'copy themes and plugins from git and push to /bitnami/wordpress/wp-content. Should work with extraVolumeMounts and extraVolumes']
##
initContainers: {}
## Make use of custom post-init.d user scripts functionality inside the bitnami/wordpress image
## ref: https://github.com/bitnami/bitnami-docker-wordpress/tree/master/5/debian-10/rootfs/post-init.d
##
## The logic of the post-init.d user scripts is that all is all files with extensions .sh, .sql or .php are executed for one time only, at the very first initialization of the pod as the very last step of entrypoint.sh.
## Example:
## customPostInitScripts:
## enable-multisite.sh: |
## #!/bin/bash
## chmod +w /bitnami/wordpress/wp-config.php
## wp core multisite-install --url=example.com --title="Welcome to the WordPress Multisite" --admin_user="doesntmatternotreallyused" --admin_password="doesntmatternotreallyused" --admin_email="user@example.com"
## cat /docker-entrypoint-init.d/.htaccess > /bitnami/wordpress/.htaccess
## chmod -w bitnami/wordpress/wp-config.php
## .htaccess: |
## RewriteEngine On
## RewriteBase /
## ...
##
## NOTE: Combined with extraVolume and extraVolumeMounts to mount the configmap to /docker-entrypoint-init.d where custom user init scripts are looked for
customPostInitScripts: {}

View File

@@ -570,3 +570,23 @@ sidecars: {}
## command: ['sh', '-c', 'copy themes and plugins from git and push to /bitnami/wordpress/wp-content. Should work with extraVolumeMounts and extraVolumes']
##
initContainers: {}
## Make use of custom post-init.d user scripts functionality inside the bitnami/wordpress image
## ref: https://github.com/bitnami/bitnami-docker-wordpress/tree/master/5/debian-10/rootfs/post-init.d
##
## The logic of the post-init.d user scripts is that all is all files with extensions .sh, .sql or .php are executed for one time only, at the very first initialization of the pod as the very last step of entrypoint.sh.
## Example:
## customPostInitScripts:
## enable-multisite.sh: |
## #!/bin/bash
## chmod +w /bitnami/wordpress/wp-config.php
## wp core multisite-install --url=example.com --title="Welcome to the WordPress Multisite" --admin_user="doesntmatternotreallyused" --admin_password="doesntmatternotreallyused" --admin_email="user@example.com"
## cat /docker-entrypoint-init.d/.htaccess > /bitnami/wordpress/.htaccess
## chmod -w bitnami/wordpress/wp-config.php
## .htaccess: |
## RewriteEngine On
## RewriteBase /
## ...
##
## NOTE: Combined with extraVolume and extraVolumeMounts to mount the configmap to /docker-entrypoint-init.d where custom user init scripts are looked for
customPostInitScripts: {}