Skip to content

Commit d8d59bd

Browse files
committed
Check for any PHP version updates.
1 parent 6337fd9 commit d8d59bd

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

php-build.bash

100644100755
Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,20 @@ echo "Pulling $docker_tag" >> output.log 2>&1
104104
# No need to continue building the image if the pull was successful.
105105
if docker pull "$docker_tag" >> output.log 2>&1;
106106
then
107-
exit
107+
# Unless the PHP version has an update...
108+
109+
# Pull latest PHP Docker image so we can check its version
110+
echo "Pulling $base_image" >> output.log 2>&1
111+
docker pull "$base_image" >> output.log 2>&1
112+
113+
# Check PHP version of the latest PHP tag and our tag
114+
base_image_php_version=$(docker run -it "$base_image" php -r "echo PHP_VERSION;")
115+
new_image_php_version=$(docker run -it "$docker_tag" php -r "echo PHP_VERSION;")
116+
117+
if new_image_php_version == base_image_php_version;
118+
then
119+
exit
120+
fi
108121
fi
109122

110123
echo "Building PHP $ACTION_PHP_VERSION with extensions: $ACTION_PHP_EXTENSIONS ..."

0 commit comments

Comments
 (0)