From 6878ea48e03969c833189ffc8ad7dd1aaa7b67b3 Mon Sep 17 00:00:00 2001 From: xZero707 Date: Fri, 19 Mar 2021 19:34:19 +0100 Subject: [PATCH] Update WordPress 5.6.2 -> 5.7.0 + Small update of logic in 10-init-wordpress --- .github/workflows/image.yml | 2 +- Dockerfile | 2 +- rootfs/etc/cont-init.d/10-init-wordpress | 5 +++++ rootfs/etc/wp-mods/wp-admin/update-core.php.patch | 6 +++--- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/image.yml b/.github/workflows/image.yml index a985297..d9c0d68 100644 --- a/.github/workflows/image.yml +++ b/.github/workflows/image.yml @@ -16,4 +16,4 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - name: Build image - run: bin/build 5.6.2 \ No newline at end of file + run: bin/build 5.7.0 \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 58b321f..f6fd78e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -ARG WP_VERSION=5.6.2 +ARG WP_VERSION=5.7.0 FROM wordpress:${WP_VERSION}-php7.4-fpm-alpine AS wordpress-builder USER root diff --git a/rootfs/etc/cont-init.d/10-init-wordpress b/rootfs/etc/cont-init.d/10-init-wordpress index 39098a6..d3d27b9 100644 --- a/rootfs/etc/cont-init.d/10-init-wordpress +++ b/rootfs/etc/cont-init.d/10-init-wordpress @@ -4,6 +4,11 @@ DISABLE_WP_UPDATES="${ENFORCE_DISABLE_WP_UPDATES:-true}" # Designed to replace original, overcomplicated entrypoint script from official wordpress docker repository # Why not use already available tools instead?! +# Removes trailing zero if found +# This is required due to inconsistencies between WodPress docker image versioning and wp-cli core download +# If patch version is 0, it is not considered by wp-cli. +WP_VERSION=$(echo "${WP_VERSION}" | sed --expression='s/.0//g'); + function disableUpdatesPatch() { if [ "${DISABLE_WP_UPDATES}" != "false" ]; then echo "> Disabling WordPress updates..." diff --git a/rootfs/etc/wp-mods/wp-admin/update-core.php.patch b/rootfs/etc/wp-mods/wp-admin/update-core.php.patch index 2f384cc..1ceb5dd 100644 --- a/rootfs/etc/wp-mods/wp-admin/update-core.php.patch +++ b/rootfs/etc/wp-mods/wp-admin/update-core.php.patch @@ -1,6 +1,6 @@ ---- update-core.php 2021-01-11 20:24:28.531750881 +0100 -+++ update-core.php 2021-01-11 20:27:11.200903166 +0100 -@@ -1049,6 +1049,11 @@ +--- update-core.php 2021-03-19 19:23:29.391214787 +0100 ++++ update-core.php 2021-03-19 19:26:23.798962792 +0100 +@@ -1050,6 +1050,11 @@ wp_die( __( 'Sorry, you are not allowed to update this site.' ) ); }