Skip to content

Commit

Permalink
Fix Conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
RobLoweMOJ committed Nov 6, 2023
2 parents 4eb4143 + 1391b95 commit 0a83f88
Show file tree
Hide file tree
Showing 9 changed files with 163 additions and 36 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/rw-build-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ jobs:
npm run production --if-present --prefix ./wordpress/wp-content/themes/justicejobs
npm install --prefix ./wordpress/wp-content/themes/hale-dash
npm run production --if-present --prefix ./wordpress/wp-content/themes/hale-dash
npm install --prefix ./wordpress/wp-content/themes/ppo
npm run production --if-present --prefix ./wordpress/wp-content/themes/ppo
- name: Build and Push Wordpress Image
run: |
docker build --pull --no-cache --tag $REGISTRY/$REPOSITORY:hale-platform_wordpress-$IMAGE_TAG --file wp.dockerfile .
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Hale Platform

This repository provides all the code required to run an instance of WordPress multisite in kubernetes. It uses the [WordPress official Alpine image](https://hub.docker.com/_/wordpress), and is modified to launch a multisite network. It uses PHP dependency manager Composer to pull in all the themes and plugins used by the multisite.
This repository provides all the code required to run an instance of WordPress multisite in kubernetes. It uses the [WordPress official Alpine image](https://hub.docker.com/_/wordpress), and is modified to launch a multisite network. It uses PHP dependency manager Composer to pull in all the themes and plugins used by the multisite.

For further technical details around the architecture, visit our wiki [overview](https://github.com/ministryofjustice/hale-platform/wiki).

Expand Down
31 changes: 22 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,32 @@
"ministryofjustice/ppo": "dev-main",
"ministryofjustice/hale-components": "dev-main",
"ministryofjustice/hale-dash": "dev-main",
"wpackagist-plugin/wordpress-seo": "*",
"ministryofjustice/ppo": "dev-main",
"ministryofjustice/hale-components": "dev-main",
"wpackagist-plugin/advanced-custom-fields-table-field":"1.3.20",
"wpackagist-plugin/advanced-responsive-video-embedder": "*",
"wpackagist-plugin/analytify-analytics-dashboard-widget":"*",
"wpackagist-plugin/classic-editor":"1.6.3",
"wpackagist-plugin/cms-tree-page-view": "*",
"wpackagist-plugin/custom-search-plugin": "*",
"wpackagist-plugin/duplicate-post":"4.5",
"wpackagist-plugin/ewww-image-optimizer": "*",
"wpackagist-plugin/expandable-menus": "*",
"wpackagist-plugin/fitvids-for-wordpress": "*",
"wpackagist-plugin/footnotes-made-easy": "*",
"wpackagist-plugin/simple-301-redirects": "*",
"wpackagist-plugin/option-tree": "*",
"wpackagist-plugin/query-monitor": "*",
"wpackagist-plugin/ewww-image-optimizer": "*",
"wpackagist-plugin/redirection": "*",
"wpackagist-plugin/remove-category-url": "*",
"wpackagist-plugin/safe-svg":"*",
"wpackagist-plugin/simple-301-redirects": "*",
"wpackagist-plugin/tao-schedule-update": "*",
"wpackagist-plugin/unconfirmed": "*",
"wpackagist-plugin/wordpress-seo": "*",
"wpackagist-plugin/wp-accessibility":"2.0.1",
"wpackagist-plugin/wp-analytify":"*",
"wpackagist-plugin/wp-force-login": "*",
"wpackagist-plugin/safe-svg":"*",
"wpackagist-plugin/redirection": "*",
"wpackagist-plugin/wps-hide-login": "*",
"wpackagist-plugin/classic-editor":"1.6.3",
"wpackagist-plugin/duplicate-post":"4.5",
"wpackagist-plugin/wp-accessibility":"2.0.1",
"wpackagist-plugin/advanced-custom-fields-table-field":"1.3.20",
"ministryofjustice/wp-moj-components": "dev-hale-platform",
"ministryofjustice/wp-user-roles": "*",
"ministryofjustice/cookie-compliance-for-wordpress": "*",
Expand All @@ -80,6 +92,7 @@
"type:wordpress-muplugin",
"ministryofjustice/wp-user-roles",
"ministryofjustice/wp-gov-uk-notify",
"ministryofjustice/hale-components",
"ministryofjustice/wp-s3-uploads"
],
"wordpress/wp-content/plugins/{$name}/": ["type:wordpress-plugin"],
Expand Down
43 changes: 25 additions & 18 deletions helm_deploy/wordpress/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,27 +52,34 @@ spec:
- secretRef:
name: hale-wp-secrets-{{ .Release.Revision }}
{{- if or (eq .Values.configmap.envtype "prod") (eq .Values.configmap.envtype "staging") }}
livenessProbe:
httpGet:
port: 443
path: /hale-wpms-2020
scheme: HTTPS
host: {{ .Values.domain }}
initialDelaySeconds: 120
periodSeconds: 30
timeoutSeconds: 5
failureThreshold: 3
# livenessProbe:
# exec:
# command:
# - sh
# - -c
# - |
# if [ -f /var/www/html/wp-load.php ]; then
# exit 0
# else
# exit 1
# fi
# initialDelaySeconds: 120
# periodSeconds: 10
# timeoutSeconds: 5
# failureThreshold: 6
# successThreshold: 1
readinessProbe:
exec:
command:
- sh
- -c
- |
if ! ps aux | grep '[p]hp-fpm: master process' >/dev/null; then
exit 1
else
exit 0
fi
- /bin/sh
- -c
- |
if [ -f /var/www/html/wp-load.php ] && ps aux | grep -q "[p]hp-fpm"
then
exit 0
else
exit 1
fi
initialDelaySeconds: 30
periodSeconds: 3
timeoutSeconds: 10
Expand Down
6 changes: 3 additions & 3 deletions helm_deploy/wordpress/templates/hpa-wordpress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ spec:
kind: Deployment
name: wordpress
{{- if eq .Values.configmap.envtype "prod" }}
minReplicas: 3
maxReplicas: 12
minReplicas: 4
maxReplicas: 5
{{- else if eq .Values.configmap.envtype "staging" }}
minReplicas: 2
maxReplicas: 4
maxReplicas: 3
{{- else if eq .Values.configmap.envtype "demo" }}
minReplicas: 2
maxReplicas: 3
Expand Down
104 changes: 104 additions & 0 deletions helm_deploy/wordpress/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,30 @@ spec:
- hosts:
- www.prisonandprobationjobs.gov.uk
secretName: ppj-www-cert
- hosts:
- nationalpreventivemechanism.org.uk
secretName: nationalpreventivemechanism-cert
- hosts:
- www.nationalpreventivemechanism.org.uk
secretName: nationalpreventivemechanism-www-cert
- hosts:
- lawcom.gov.uk
secretName: lawcom-cert
- hosts:
- www.lawcom.gov.uk
secretName: lawcom-www-cert
- hosts:
- jobs.justice.gov.uk
secretName: justicejobs-cert
- hosts:
- www.jobs.justice.gov.uk
secretName: justicejobs-www-cert
- hosts:
- ppo.gov.uk
secretName: ppo-cert
- hosts:
- www.ppo.gov.uk
secretName: ppo-www-cert
{{- end }}
rules:
- host: {{ .Values.domain }}
Expand Down Expand Up @@ -218,5 +242,85 @@ spec:
name: wordpress
port:
number: 8080
- host: nationalpreventivemechanism.org.uk
http:
paths:
- path: /
pathType: ImplementationSpecific
backend:
service:
name: wordpress
port:
number: 8080
- host: www.nationalpreventivemechanism.org.uk
http:
paths:
- path: /
pathType: ImplementationSpecific
backend:
service:
name: wordpress
port:
number: 8080
- host: lawcom.gov.uk
http:
paths:
- path: /
pathType: ImplementationSpecific
backend:
service:
name: wordpress
port:
number: 8080
- host: www.lawcom.gov.uk
http:
paths:
- path: /
pathType: ImplementationSpecific
backend:
service:
name: wordpress
port:
number: 8080
- host: jobs.justice.gov.uk
http:
paths:
- path: /
pathType: ImplementationSpecific
backend:
service:
name: wordpress
port:
number: 8080
- host: www.jobs.justice.gov.uk
http:
paths:
- path: /
pathType: ImplementationSpecific
backend:
service:
name: wordpress
port:
number: 8080
- host: ppo.gov.uk
http:
paths:
- path: /
pathType: ImplementationSpecific
backend:
service:
name: wordpress
port:
number: 8080
- host: www.ppo.gov.uk
http:
paths:
- path: /
pathType: ImplementationSpecific
backend:
service:
name: wordpress
port:
number: 8080
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion helm_deploy/wordpress/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ wp:
# Default if HPA is not turned on
replicaCount:
prod: 3
staging: 3
staging: 2
dev: 1
demo: 2

Expand Down
1 change: 1 addition & 0 deletions opt/php/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

require WPMU_PLUGIN_DIR .'/wp-gov-uk-notify/wp-gov-uk-notify.php';
require WPMU_PLUGIN_DIR .'/wp-moj-components/wp-moj-components.php';
require WPMU_PLUGIN_DIR .'/hale-components/hale-components.php';
require WPMU_PLUGIN_DIR .'/wp-user-roles/wp-user-roles.php';

# Turn off s3 upload plugin in the local environment
Expand Down
8 changes: 4 additions & 4 deletions opt/php/www.conf
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
; Unix user/group of processes
; Note: The user is mandatory. If the group is not set, the default user's group
; will be used.
; user = hale
; group = hale
user = hale
group = hale

; The address on which to accept FastCGI requests.
; Valid syntaxes are:
Expand Down Expand Up @@ -111,7 +111,7 @@ pm = dynamic
; forget to tweak pm.* to fit your needs.
; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
; Note: This value is mandatory.
pm.max_children = 90
pm.max_children = 80

; The number of child processes created on startup.
; Note: Used only when pm is set to 'dynamic'
Expand All @@ -121,7 +121,7 @@ pm.start_servers = 10
; The desired minimum number of idle server processes.
; Note: Used only when pm is set to 'dynamic'
; Note: Mandatory when pm is set to 'dynamic'
pm.min_spare_servers = 5
pm.min_spare_servers = 10

; The desired maximum number of idle server processes.
; Note: Used only when pm is set to 'dynamic'
Expand Down

0 comments on commit 0a83f88

Please sign in to comment.