-
Notifications
You must be signed in to change notification settings - Fork 2
Add support for multiple PHP versions (8.0, 8.1, 8.2, 8.3) with WordPress 6.0-6.8 and consolidated CI builds #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
ca70d22
a2c80d0
d910c41
1cdc96b
6eadd83
51313b9
055e4a3
9b16391
ff2557c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,27 +1,30 @@ | ||
| FROM alpine:3.14 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @copilot the "main" docker file can be deleted, let's jsut have one per PHP version
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed the main Dockerfile as requested. Now using only PHP-specific Dockerfiles (Dockerfile.php8.0, Dockerfile.php8.1, Dockerfile.php8.2, Dockerfile.php8.3). The latest tag build uses Dockerfile.php8.3 with WordPress 6.8. Commit 51313b9 |
||
| FROM public.ecr.aws/docker/library/alpine:3.16 | ||
|
|
||
| ARG WP_VERSION=6.8 | ||
| ARG WP_VERSION | ||
|
|
||
| RUN apk add -u --no-cache \ | ||
| composer \ | ||
| git \ | ||
| imagemagick \ | ||
| mysql \ | ||
| mysql-client \ | ||
| php7 \ | ||
| php7-curl \ | ||
| php7-dom \ | ||
| php7-exif \ | ||
| php7-mysqli \ | ||
| php7-pecl-imagick \ | ||
| php7-simplexml \ | ||
| php7-tokenizer \ | ||
| php7-xml \ | ||
| php7-xmlwriter | ||
|
|
||
| RUN apk add --no-cache php7-pear php7-dev gcc musl-dev make \ | ||
| && pecl install pcov && echo extension=pcov.so > /etc/php7/conf.d/pcov.ini \ | ||
| && apk del php7-pear php7-dev gcc musl-dev make | ||
| php8 \ | ||
| php8-curl \ | ||
| php8-dom \ | ||
| php8-exif \ | ||
| php8-mysqli \ | ||
| php8-pecl-imagick \ | ||
| php8-simplexml \ | ||
| php8-tokenizer \ | ||
| php8-xml \ | ||
| php8-xmlwriter | ||
|
|
||
| RUN apk add --no-cache php8-pear php8-dev gcc musl-dev make \ | ||
| && pecl8 install pcov && echo extension=pcov.so > /etc/php8/conf.d/pcov.ini \ | ||
| && apk del php8-pear php8-dev gcc musl-dev make | ||
|
|
||
| # Create php symlink to php8 | ||
| RUN ln -sf /usr/bin/php8 /usr/bin/php | ||
|
|
||
| RUN wget -nv -O /tmp/wordpress.tar.gz https://wordpress.org/wordpress-${WP_VERSION}.tar.gz \ | ||
| && mkdir /wordpress \ | ||
|
|
@@ -44,4 +47,4 @@ WORKDIR /code | |
| COPY ./docker-entrypoint.sh /entrypoint.sh | ||
| COPY ./wp-tests-config.php /wp-tests-config.php | ||
| RUN chmod 755 /entrypoint.sh | ||
| ENTRYPOINT ["/entrypoint.sh"] | ||
| ENTRYPOINT ["/entrypoint.sh"] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| FROM public.ecr.aws/docker/library/alpine:3.19 | ||
|
|
||
| ARG WP_VERSION | ||
|
|
||
| RUN apk add -u --no-cache \ | ||
| composer \ | ||
| git \ | ||
| imagemagick \ | ||
| mysql \ | ||
| mysql-client \ | ||
| php81 \ | ||
| php81-curl \ | ||
| php81-dom \ | ||
| php81-exif \ | ||
| php81-mysqli \ | ||
| php81-pecl-imagick \ | ||
| php81-simplexml \ | ||
| php81-tokenizer \ | ||
| php81-xml \ | ||
| php81-xmlwriter | ||
|
|
||
| RUN apk add --no-cache php81-pear php81-dev gcc musl-dev make \ | ||
| && pecl81 install pcov && echo extension=pcov.so > /etc/php81/conf.d/pcov.ini \ | ||
| && apk del php81-pear php81-dev gcc musl-dev make | ||
|
|
||
| # Create php symlink to php81 | ||
| RUN ln -sf /usr/bin/php81 /usr/bin/php | ||
|
|
||
| RUN wget -nv -O /tmp/wordpress.tar.gz https://wordpress.org/wordpress-${WP_VERSION}.tar.gz \ | ||
| && mkdir /wordpress \ | ||
| && tar --strip-components=1 -zxmf /tmp/wordpress.tar.gz -C /wordpress \ | ||
| && rm /tmp/wordpress.tar.gz | ||
|
|
||
| RUN wget -nv -O /tmp/wp-phpunit.tar.gz https://github.com/wp-phpunit/wp-phpunit/archive/${WP_VERSION}.0.tar.gz \ | ||
| && mkdir /wp-phpunit \ | ||
| && tar --strip-components=1 -zxmf /tmp/wp-phpunit.tar.gz -C /wp-phpunit \ | ||
| && rm /tmp/wp-phpunit.tar.gz | ||
|
|
||
| RUN mysql_install_db --user=mysql --ldata=/var/lib/mysql | ||
| RUN sh -c 'mysqld_safe --datadir=/var/lib/mysql &' && sleep 4 && mysql -u root -e "CREATE DATABASE wordpress" | ||
|
|
||
| ENV WP_DEVELOP_DIR=/wp-phpunit | ||
| ENV WP_PHPUNIT__TESTS_CONFIG=/wp-tests-config.php | ||
|
|
||
| VOLUME ["/code"] | ||
| WORKDIR /code | ||
| COPY ./docker-entrypoint.sh /entrypoint.sh | ||
| COPY ./wp-tests-config.php /wp-tests-config.php | ||
| RUN chmod 755 /entrypoint.sh | ||
| ENTRYPOINT ["/entrypoint.sh"] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| FROM public.ecr.aws/docker/library/alpine:3.19 | ||
|
|
||
| ARG WP_VERSION | ||
|
|
||
| RUN apk add -u --no-cache \ | ||
| composer \ | ||
| git \ | ||
| imagemagick \ | ||
| mysql \ | ||
| mysql-client \ | ||
| php82 \ | ||
| php82-curl \ | ||
| php82-dom \ | ||
| php82-exif \ | ||
| php82-mysqli \ | ||
| php82-pecl-imagick \ | ||
| php82-simplexml \ | ||
| php82-tokenizer \ | ||
| php82-xml \ | ||
| php82-xmlwriter | ||
|
|
||
| RUN apk add --no-cache php82-pear php82-dev gcc musl-dev make \ | ||
| && pecl82 install pcov && echo extension=pcov.so > /etc/php82/conf.d/pcov.ini \ | ||
| && apk del php82-pear php82-dev gcc musl-dev make | ||
|
|
||
| # Create php symlink to php82 | ||
| RUN ln -sf /usr/bin/php82 /usr/bin/php | ||
|
|
||
| RUN wget -nv -O /tmp/wordpress.tar.gz https://wordpress.org/wordpress-${WP_VERSION}.tar.gz \ | ||
| && mkdir /wordpress \ | ||
| && tar --strip-components=1 -zxmf /tmp/wordpress.tar.gz -C /wordpress \ | ||
| && rm /tmp/wordpress.tar.gz | ||
|
|
||
| RUN wget -nv -O /tmp/wp-phpunit.tar.gz https://github.com/wp-phpunit/wp-phpunit/archive/${WP_VERSION}.0.tar.gz \ | ||
| && mkdir /wp-phpunit \ | ||
| && tar --strip-components=1 -zxmf /tmp/wp-phpunit.tar.gz -C /wp-phpunit \ | ||
| && rm /tmp/wp-phpunit.tar.gz | ||
|
|
||
| RUN mysql_install_db --user=mysql --ldata=/var/lib/mysql | ||
| RUN sh -c 'mysqld_safe --datadir=/var/lib/mysql &' && sleep 4 && mysql -u root -e "CREATE DATABASE wordpress" | ||
|
|
||
| ENV WP_DEVELOP_DIR=/wp-phpunit | ||
| ENV WP_PHPUNIT__TESTS_CONFIG=/wp-tests-config.php | ||
|
|
||
| VOLUME ["/code"] | ||
| WORKDIR /code | ||
| COPY ./docker-entrypoint.sh /entrypoint.sh | ||
| COPY ./wp-tests-config.php /wp-tests-config.php | ||
| RUN chmod 755 /entrypoint.sh | ||
| ENTRYPOINT ["/entrypoint.sh"] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| FROM public.ecr.aws/docker/library/alpine:3.19 | ||
|
|
||
| ARG WP_VERSION | ||
|
|
||
| RUN apk add -u --no-cache \ | ||
| composer \ | ||
| git \ | ||
| imagemagick \ | ||
| mysql \ | ||
| mysql-client \ | ||
| php83 \ | ||
| php83-curl \ | ||
| php83-dom \ | ||
| php83-exif \ | ||
| php83-mysqli \ | ||
| php83-pecl-imagick \ | ||
| php83-simplexml \ | ||
| php83-tokenizer \ | ||
| php83-xml \ | ||
| php83-xmlwriter | ||
|
|
||
| RUN apk add --no-cache php83-pear php83-dev gcc musl-dev make \ | ||
| && pecl83 install pcov && echo extension=pcov.so > /etc/php83/conf.d/pcov.ini \ | ||
| && apk del php83-pear php83-dev gcc musl-dev make | ||
|
|
||
| # Create php symlink to php83 | ||
| RUN ln -sf /usr/bin/php83 /usr/bin/php | ||
|
|
||
| RUN wget -nv -O /tmp/wordpress.tar.gz https://wordpress.org/wordpress-${WP_VERSION}.tar.gz \ | ||
| && mkdir /wordpress \ | ||
| && tar --strip-components=1 -zxmf /tmp/wordpress.tar.gz -C /wordpress \ | ||
| && rm /tmp/wordpress.tar.gz | ||
|
|
||
| RUN wget -nv -O /tmp/wp-phpunit.tar.gz https://github.com/wp-phpunit/wp-phpunit/archive/${WP_VERSION}.0.tar.gz \ | ||
| && mkdir /wp-phpunit \ | ||
| && tar --strip-components=1 -zxmf /tmp/wp-phpunit.tar.gz -C /wp-phpunit \ | ||
| && rm /tmp/wp-phpunit.tar.gz | ||
|
|
||
| RUN mysql_install_db --user=mysql --ldata=/var/lib/mysql | ||
| RUN sh -c 'mysqld_safe --datadir=/var/lib/mysql &' && sleep 4 && mysql -u root -e "CREATE DATABASE wordpress" | ||
|
|
||
| ENV WP_DEVELOP_DIR=/wp-phpunit | ||
| ENV WP_PHPUNIT__TESTS_CONFIG=/wp-tests-config.php | ||
|
|
||
| VOLUME ["/code"] | ||
| WORKDIR /code | ||
| COPY ./docker-entrypoint.sh /entrypoint.sh | ||
| COPY ./wp-tests-config.php /wp-tests-config.php | ||
| RUN chmod 755 /entrypoint.sh | ||
| ENTRYPOINT ["/entrypoint.sh"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about PHP 8.4?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thikn we can add in a follow up, wp is still 8.4 beta support I beleive