diff --git a/doc/docker/fpm/Dockerfile b/doc/docker/fpm/Dockerfile index 8dd98ecceb..dc6f39b65d 100644 --- a/doc/docker/fpm/Dockerfile +++ b/doc/docker/fpm/Dockerfile @@ -17,7 +17,8 @@ RUN apt-get update \ && apt-get install -y software-properties-common \ && LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php \ && apt-get update \ - && bash -c "apt-get install -y php$PHP_VERSION-{cli,mysql,json,gd,xsl,bz2,opcache,apcu,tidy,zip,bcmath,mbstring,smbclient,ldap,curl,fpm,pgsql,gmp,memcached}" \ + && bash -c "apt-get install -y php$PHP_VERSION-{cli,mysql,gd,xsl,bz2,opcache,apcu,tidy,zip,bcmath,mbstring,smbclient,ldap,curl,fpm,pgsql,gmp,memcached}" \ + && bash -c "[[ $PHP_VERSION =~ ^8\..* ]] || apt-get install -y php$PHP_VERSION-json" \ # fpm and php.ini settings && sed -e 's/^;\?listen \?=.*/listen = 9000/g' \ -e '/allowed_clients/d' \ @@ -68,9 +69,10 @@ fi; \ rm composer-setup.php; \ exit $RESULT' \ # build EGroupware - && cd /usr/share \ && composer.phar self-update 1.8.6 \ - && composer.phar create-project --prefer-dist --no-scripts --no-dev egroupware/egroupware:$VERSION \ + && cd /usr/share \ + && [ $PHP_VERSION = "8.0" ] && COMPOSER_EXTRA=--ignore-platform-reqs || true \ + && composer.phar create-project $COMPOSER_EXTRA --prefer-dist --no-scripts --no-dev egroupware/egroupware:$VERSION \ && cd egroupware \ && npm install \ && grunt \ diff --git a/doc/docker/fpm/build.sh b/doc/docker/fpm/build.sh index 0a2de26f4c..7e8228c289 100755 --- a/doc/docker/fpm/build.sh +++ b/doc/docker/fpm/build.sh @@ -1,4 +1,5 @@ #!/bin/bash -x +# To build PHP 8 snapshots out of master: doc/docker/fpm/build.sh 8.0 21.1. master cd $(dirname $0) @@ -13,18 +14,19 @@ fi DEFAULT=$(git branch|grep ^*|cut -c3-) TAG=${1:-$DEFAULT} -VERSION=$TAG +VERSION=${2:-$TAG} BRANCH=$(echo $VERSION|sed 's/\.[0-9]\{8\}$//') -[ $VERSION = $BRANCH ] && VERSION="$BRANCH.x-dev" +[ $VERSION = $BRANCH ] && VERSION="dev-$BRANCH" -[ $VERSION = "$DEFAULT.x-dev" ] && { - grep self.version composer.json | while read pack version; do composer update $(echo $pack|cut -d'"' -f2); done +[ $VERSION = "dev-$DEFAULT" ] && ( + cd ../../.. + composer update 'egroupware/*' git status composer.lock|grep composer.lock && { git stash; git pull --rebase; git stash pop git commit -m 'updating composer.lock with latest commit hashed for egroupware/* packages' composer.lock VERSION="$VERSION#$(git push|grep $DEFAULT|cut -c4-10)" } -} +) # add PHP_VERSION to TAG, if not the default PHP version [ $PHP_VERSION != $DEFAULT_PHP_VERSION ] && TAG=$TAG-$PHP_VERSION @@ -39,7 +41,7 @@ docker build --no-cache --build-arg "VERSION=$VERSION" --build-arg "PHP_VERSION= # docker tag egroupware/egroupware:$TAG egroupware/egroupware:latest # docker push egroupware/egroupware:latest #} - [ "$BRANCH" != $VERSION -a "${BRANCH}.x-dev" != $VERSION ] && { + [ "$BRANCH" != $VERSION -a "dev-${BRANCH}" != $VERSION ] && { docker tag egroupware/egroupware:$TAG egroupware/egroupware:$BRANCH docker push egroupware/egroupware:$BRANCH }