Skip to content

Commit

Permalink
Update pecl extensions in update.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
J0WI committed Nov 23, 2018
1 parent df34b1a commit bf06118
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Dockerfile-alpine.template
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ RUN set -ex; \
; \
\
# pecl will claim success even if one install fails, so we need to perform each install separately
pecl install APCu-5.1.14; \
pecl install geoip-1.1.1; \
pecl install redis-3.1.6; \
pecl install APCu-%%APCU_VERSION%%; \
pecl install geoip-%%GEOIP_VERSION%%; \
pecl install redis-%%REDIS_VERSION%%; \
\
docker-php-ext-enable \
apcu \
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile-debian.template
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ RUN set -ex; \
; \
\
# pecl will claim success even if one install fails, so we need to perform each install separately
pecl install APCu-5.1.14; \
pecl install geoip-1.1.1; \
pecl install redis-3.1.6; \
pecl install APCu-%%APCU_VERSION%%; \
pecl install geoip-%%GEOIP_VERSION%%; \
pecl install redis-%%REDIS_VERSION%%; \
\
docker-php-ext-enable \
apcu \
Expand Down
29 changes: 29 additions & 0 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,32 @@ latest="$(
| tail -1
)"

apcu_version="$(
git ls-remote --tags https://github.com/krakjoe/apcu.git \
| cut -d/ -f3 \
| grep -vE -- '-rc|-b' \
| sed -E 's/^v//' \
| sort -V \
| tail -1
)"

# Todo: check for 4.x compatibility
redis_version="$(
git ls-remote --tags https://github.com/phpredis/phpredis.git \
| cut -d/ -f3 \
| grep -viE '[a-z]' \
| tr -d '^{}' \
| grep -E '^3\.' \
| sort -V \
| tail -1
)"

declare -A pecl_versions=(
[APCu]="$apcu_version"
[geoip]="1.1.1" # Todo: fetch latest tag from SVN repo
[redis]="$redis_version"
)

set -x

for variant in apache fpm fpm-alpine; do
Expand All @@ -31,6 +57,9 @@ for variant in apache fpm fpm-alpine; do
sed -ri -e '
s/%%VARIANT%%/'"$variant"'/;
s/%%VERSION%%/'"$latest"'/;
s/%%APCU_VERSION%%/'"${pecl_versions[APCu]}"'/g;
s/%%GEOIP_VERSION%%/'"${pecl_versions[geoip]}"'/g;
s/%%REDIS_VERSION%%/'"${pecl_versions[redis]}"'/g;
s/%%CMD%%/'"${cmd[$variant]}"'/;
' "$variant/Dockerfile"
done

0 comments on commit bf06118

Please sign in to comment.