Skip to content

Commit 3a1ae6c

Browse files
committed
Cleanup.
1 parent d8d59bd commit 3a1ae6c

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

php-build.bash

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,18 @@ if docker pull "$docker_tag" >> output.log 2>&1;
106106
then
107107
# Unless the PHP version has an update...
108108

109-
# Pull latest PHP Docker image so we can check its version
109+
# Pull latest PHP Docker image so we can check its version.
110110
echo "Pulling $base_image" >> output.log 2>&1
111111
docker pull "$base_image" >> output.log 2>&1
112112

113-
# Check PHP version of the latest PHP tag and our tag
113+
# Check PHP versions of the latest PHP tag and our tag.
114114
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;")
115+
cached_image_php_version=$(docker run -it "$docker_tag" php -r "echo PHP_VERSION;")
116116

117-
if new_image_php_version == base_image_php_version;
117+
echo "Comparing $cached_image_php_version (cached) to $base_image_php_version (latest)." >> output.log 2>&1
118+
119+
# No need to continue building if our image already exists and PHP is up-to-date.
120+
if cached_image_php_version == base_image_php_version;
118121
then
119122
exit
120123
fi

0 commit comments

Comments
 (0)