Skip to content

Commit bf06118

Browse files
committed
Update pecl extensions in update.sh
1 parent df34b1a commit bf06118

File tree

3 files changed

+35
-6
lines changed

3 files changed

+35
-6
lines changed

Dockerfile-alpine.template

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ RUN set -ex; \
2828
; \
2929
\
3030
# pecl will claim success even if one install fails, so we need to perform each install separately
31-
pecl install APCu-5.1.14; \
32-
pecl install geoip-1.1.1; \
33-
pecl install redis-3.1.6; \
31+
pecl install APCu-%%APCU_VERSION%%; \
32+
pecl install geoip-%%GEOIP_VERSION%%; \
33+
pecl install redis-%%REDIS_VERSION%%; \
3434
\
3535
docker-php-ext-enable \
3636
apcu \

Dockerfile-debian.template

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ RUN set -ex; \
2828
; \
2929
\
3030
# pecl will claim success even if one install fails, so we need to perform each install separately
31-
pecl install APCu-5.1.14; \
32-
pecl install geoip-1.1.1; \
33-
pecl install redis-3.1.6; \
31+
pecl install APCu-%%APCU_VERSION%%; \
32+
pecl install geoip-%%GEOIP_VERSION%%; \
33+
pecl install redis-%%REDIS_VERSION%%; \
3434
\
3535
docker-php-ext-enable \
3636
apcu \

update.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,32 @@ latest="$(
2121
| tail -1
2222
)"
2323

24+
apcu_version="$(
25+
git ls-remote --tags https://github.com/krakjoe/apcu.git \
26+
| cut -d/ -f3 \
27+
| grep -vE -- '-rc|-b' \
28+
| sed -E 's/^v//' \
29+
| sort -V \
30+
| tail -1
31+
)"
32+
33+
# Todo: check for 4.x compatibility
34+
redis_version="$(
35+
git ls-remote --tags https://github.com/phpredis/phpredis.git \
36+
| cut -d/ -f3 \
37+
| grep -viE '[a-z]' \
38+
| tr -d '^{}' \
39+
| grep -E '^3\.' \
40+
| sort -V \
41+
| tail -1
42+
)"
43+
44+
declare -A pecl_versions=(
45+
[APCu]="$apcu_version"
46+
[geoip]="1.1.1" # Todo: fetch latest tag from SVN repo
47+
[redis]="$redis_version"
48+
)
49+
2450
set -x
2551

2652
for variant in apache fpm fpm-alpine; do
@@ -31,6 +57,9 @@ for variant in apache fpm fpm-alpine; do
3157
sed -ri -e '
3258
s/%%VARIANT%%/'"$variant"'/;
3359
s/%%VERSION%%/'"$latest"'/;
60+
s/%%APCU_VERSION%%/'"${pecl_versions[APCu]}"'/g;
61+
s/%%GEOIP_VERSION%%/'"${pecl_versions[geoip]}"'/g;
62+
s/%%REDIS_VERSION%%/'"${pecl_versions[redis]}"'/g;
3463
s/%%CMD%%/'"${cmd[$variant]}"'/;
3564
' "$variant/Dockerfile"
3665
done

0 commit comments

Comments
 (0)