Skip to content

Commit c46c08e

Browse files
committed
feat(wordpress): write WordPress version
1 parent e51d8da commit c46c08e

File tree

4 files changed

+12
-634
lines changed

4 files changed

+12
-634
lines changed

wordpress/.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
!dev-tools
33
!extra
44
!scripts
5+
!entrypoint.sh

wordpress/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ ARG WP_GIT_REF
44
ADD https://github.com/WordPress/WordPress.git#${WP_GIT_REF} /wp
55
RUN rm -rf /wp/wp-content
66
COPY extra/ /wp/
7+
RUN echo "${WP_GIT_REF}" > /wp/wp-content/.version
78

89
FROM alpine:3.21.3@sha256:a8560b36e8b8210634f77d9f7f9efd7ffa463e380b75e2e74aff4511df3ef88c AS build-wptl
910
ARG WP_GIT_REF

wordpress/entrypoint.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/sh
2+
3+
USER_ID="${1:-1000}"
4+
GROUP_ID="${2:-1000}"
5+
6+
if [ ! -f /wp/wp-content/.version ] || [ ! -f /shared/wp-content/.version ] || ! cmp -s /wp/wp-content/.version /shared/wp-content/.version; then
7+
/usr/bin/rsync -ac --delete --chown="${USER_ID}:${GROUP_ID}" --include=/wp-content/.version /wp/ /shared/
8+
fi
9+
10+
/usr/bin/rsync -ac --delete --chown="${USER_ID}:${GROUP_ID}" /dev-tools/

0 commit comments

Comments
 (0)