From d8d59bd1e659388479a49de58ff000efcd6f33f1 Mon Sep 17 00:00:00 2001 From: Seth Westphal Date: Thu, 25 Apr 2024 18:38:29 -0500 Subject: [PATCH] Check for any PHP version updates. --- php-build.bash | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) mode change 100644 => 100755 php-build.bash diff --git a/php-build.bash b/php-build.bash old mode 100644 new mode 100755 index b977aca..b0dc8d9 --- a/php-build.bash +++ b/php-build.bash @@ -104,7 +104,20 @@ echo "Pulling $docker_tag" >> output.log 2>&1 # No need to continue building the image if the pull was successful. if docker pull "$docker_tag" >> output.log 2>&1; then - exit + # Unless the PHP version has an update... + + # Pull latest PHP Docker image so we can check its version + echo "Pulling $base_image" >> output.log 2>&1 + docker pull "$base_image" >> output.log 2>&1 + + # Check PHP version of the latest PHP tag and our tag + base_image_php_version=$(docker run -it "$base_image" php -r "echo PHP_VERSION;") + new_image_php_version=$(docker run -it "$docker_tag" php -r "echo PHP_VERSION;") + + if new_image_php_version == base_image_php_version; + then + exit + fi fi echo "Building PHP $ACTION_PHP_VERSION with extensions: $ACTION_PHP_EXTENSIONS ..."