Skip to content

Commit

Permalink
Merge pull request #185 from brefphp/php84
Browse files Browse the repository at this point in the history
Add PHP 8.4 alpha
  • Loading branch information
mnapoli authored Jul 10, 2024
2 parents 3f16ddc + 69b02aa commit 9bf3adc
Show file tree
Hide file tree
Showing 5 changed files with 575 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
script: |
const matrix = {
cpu: ['x86', 'arm'],
php_version: ['80', '81', '82', '83'],
php_version: ['80', '81', '82', '83', '84'],
}
// If this is a third-party pull request, skip ARM builds
Expand Down
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ default: docker-images layers


# Build Docker images *locally*
docker-images: docker-images-php-80 docker-images-php-81 docker-images-php-82 docker-images-php-83
docker-images: docker-images-php-80 docker-images-php-81 docker-images-php-82 docker-images-php-83 docker-images-php-84
docker-images-php-%:
PHP_VERSION=$* ${BAKE_COMMAND} --load


# Build Lambda layers (zip files) *locally*
layers: layer-php-80 layer-php-81 layer-php-82 layer-php-83 layer-php-80-fpm layer-php-81-fpm layer-php-82-fpm layer-php-83-fpm
layers: layer-php-80 layer-php-81 layer-php-82 layer-php-83 layer-php-80-fpm layer-php-81-fpm layer-php-82-fpm layer-php-83-fpm layer-php-84-fpm
# Build the console layer only once (x86 and single PHP version)
@if [ ${CPU} = "x86" ]; then \
$(MAKE) layer-console; \
Expand All @@ -57,7 +57,7 @@ layer-%:
# Upload the layers to AWS Lambda
# Uses the current AWS_PROFILE. Most users will not want to use this option
# as this will publish all layers to all regions + publish all Docker images.
upload-layers: upload-layers-php-80 upload-layers-php-81 upload-layers-php-82 upload-layers-php-83
upload-layers: upload-layers-php-80 upload-layers-php-81 upload-layers-php-82 upload-layers-php-83 upload-layers-php-84
# Upload the console layer only once (x86 and single PHP version)
@if [ ${CPU} = "x86" ]; then \
LAYER_NAME=console $(MAKE) -C ./utils/lambda-publish publish-parallel; \
Expand All @@ -70,7 +70,7 @@ upload-layers-php-%:


# Publish Docker images to Docker Hub.
upload-to-docker-hub: upload-to-docker-hub-php-80 upload-to-docker-hub-php-81 upload-to-docker-hub-php-82 upload-to-docker-hub-php-83
upload-to-docker-hub: upload-to-docker-hub-php-80 upload-to-docker-hub-php-81 upload-to-docker-hub-php-82 upload-to-docker-hub-php-83 upload-to-docker-hub-php-84
upload-to-docker-hub-php-%:
# Make sure we have defined the docker tag
(test $(DOCKER_TAG)) && echo "Tagging images with \"${DOCKER_TAG}\"" || echo "You have to define environment variable DOCKER_TAG"
Expand All @@ -86,12 +86,12 @@ upload-to-docker-hub-php-%:
done


test: test-80 test-81 test-82 test-83
test: test-80 test-81 test-82 test-83 test-84
test-%:
cd tests && $(MAKE) test-$*


clean: clean-80 clean-81 clean-82 clean-83
clean: clean-80 clean-81 clean-82 clean-83 clean-84
# Clear the build cache, else all images will be rebuilt using cached layers
docker builder prune
# Remove zip files
Expand Down
8 changes: 4 additions & 4 deletions layers/fpm-dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ ARG PHP_VERSION
RUN mkdir -p /opt/bref/extensions

# Install xdebug
RUN pecl install xdebug
RUN cp $(php -r "echo ini_get('extension_dir');")/xdebug.so /opt/bref/extensions
RUN if [ $PHP_VERSION != "84" ]; then pecl install xdebug; fi
RUN if [ $PHP_VERSION != "84" ]; then cp $(php -r "echo ini_get('extension_dir');")/xdebug.so /opt/bref/extensions; fi

# Install Blackfire
# https://blackfire.io/docs/up-and-running/installation?action=install&mode=full&version=latest&mode=full&location=server&os=manual&language=php#install-the-php-probe
ARG BLACKFIRE_VERSION=1.87.2
RUN if [ $PHP_VERSION != "83" ] && [ $CPU_PREFIX == "" ]; then curl -A "Docker" -o /opt/bref/extensions/blackfire.so -L -s "https://packages.blackfire.io/binaries/blackfire-php/$BLACKFIRE_VERSION/blackfire-php-linux_amd64-php-"$PHP_VERSION".so"; fi
RUN if [ $PHP_VERSION != "83" ] && [ $CPU_PREFIX == "arm-" ]; then curl -A "Docker" -o /opt/bref/extensions/blackfire.so -L -s "https://packages.blackfire.io/binaries/blackfire-php/$BLACKFIRE_VERSION/blackfire-php-linux_arm64-php-"$PHP_VERSION".so"; fi
RUN if [ $PHP_VERSION != "83" ] && [ $PHP_VERSION != "84" ] && [ $CPU_PREFIX == "" ]; then curl -A "Docker" -o /opt/bref/extensions/blackfire.so -L -s "https://packages.blackfire.io/binaries/blackfire-php/$BLACKFIRE_VERSION/blackfire-php-linux_amd64-php-"$PHP_VERSION".so"; fi
RUN if [ $PHP_VERSION != "83" ] && [ $PHP_VERSION != "84" ] && [ $CPU_PREFIX == "arm-" ]; then curl -A "Docker" -o /opt/bref/extensions/blackfire.so -L -s "https://packages.blackfire.io/binaries/blackfire-php/$BLACKFIRE_VERSION/blackfire-php-linux_arm64-php-"$PHP_VERSION".so"; fi


FROM bref/${CPU_PREFIX}php-${PHP_VERSION}-fpm
Expand Down
Loading

0 comments on commit 9bf3adc

Please sign in to comment.