44
44
fi
45
45
base_image=" ${base_image} cli-alpine"
46
46
dockerfile=" FROM ${base_image}
47
- RUN apk add --update --no-cache bash coreutils git make openssh patch unzip zip"
47
+ RUN apk add --update --no-cache bash coreutils git make openssh patch unzip zip
48
+ # INI settings to set within Github Action's build runner
49
+ RUN echo 'memory_limit=4G' > /usr/local/etc/php/conf.d/php-build.ini"
48
50
49
51
base_repo=" $1 "
50
52
73
75
done
74
76
dockerfile_unique=" ${dockerfile_unique} -${php_build_version} "
75
77
76
- dockerfile=" ${dockerfile}
77
- ADD ./php-build.ini /usr/local/etc/php/conf.d"
78
-
79
- cat > ./php-build.ini<< EOF
80
- ;INI settings to set within Github Action's build runner
81
- memory_limit=4G
82
- EOF
83
-
84
78
# Remove illegal characters and make lowercase:
85
79
GITHUB_REPOSITORY=" ${GITHUB_REPOSITORY,,} "
86
80
dockerfile_unique=" ${dockerfile_unique// / _} "
@@ -102,23 +96,24 @@ echo "$docker_tag" > ./docker_tag
102
96
echo " Pulling $docker_tag " >> output.log 2>&1
103
97
104
98
# No need to continue building the image if the pull was successful.
105
- if docker pull " $docker_tag " >> output.log 2>&1 ;
106
- then
99
+ if docker pull " $docker_tag " >> output.log 2>&1 ; then
107
100
# Unless the PHP version has an update...
108
101
109
102
# Pull latest PHP Docker image so we can check its version.
110
103
echo " Pulling $base_image " >> output.log 2>&1
111
- docker pull " $base_image " >> output.log 2>&1
112
-
113
- # Check PHP versions of the latest PHP tag and our tag.
114
- base_image_php_version=$( docker run -i " $base_image " php -r " echo PHP_VERSION;" )
115
- cached_image_php_version=$( docker run -i " $docker_tag " php -r " echo PHP_VERSION;" )
116
-
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 ];
121
- then
104
+ if docker pull " $base_image " >> output.log 2>&1 ; then
105
+ # Check PHP versions of the latest PHP tag and our tag.
106
+ base_image_php_version=$( docker run -i " $base_image " php -r " echo PHP_VERSION;" )
107
+ cached_image_php_version=$( docker run -i " $docker_tag " php -r " echo PHP_VERSION;" )
108
+
109
+ echo " Comparing $cached_image_php_version (cached) to $base_image_php_version (latest)." >> output.log 2>&1
110
+
111
+ # No need to continue building if our image already exists and PHP is up-to-date.
112
+ if [ $cached_image_php_version == $base_image_php_version ]; then
113
+ exit
114
+ fi
115
+ else
116
+ echo " Pulling from upstream failed, ignoring update check" >> output.log 2>&1
122
117
exit
123
118
fi
124
119
fi
0 commit comments