Commit 82cd36b3 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Améliorations.

parent cd9dc595
...@@ -13,6 +13,9 @@ ENV PHP_CONF_DIR=/etc/php/${PHP_VERSION} ...@@ -13,6 +13,9 @@ ENV PHP_CONF_DIR=/etc/php/${PHP_VERSION}
RUN pecl install ast && \ RUN pecl install ast && \
echo "extension=ast.so" > ${PHP_CONF_DIR}/cli/conf.d/ast.ini echo "extension=ast.so" > ${PHP_CONF_DIR}/cli/conf.d/ast.ini
# PHAN n'aime pas xdebug
RUN phpdismod xdebug
# Nettoyage # Nettoyage
RUN apt-get autoremove -y && apt-get clean && rm -rf /tmp/* /var/tmp/* RUN apt-get autoremove -y && apt-get clean && rm -rf /tmp/* /var/tmp/*
......
# check-compat
Tester la compatibilité des bibliothèques `unicaen/*` avec une version précise de PHP.
## PHP 7.0
```bash
docker run \
--rm \
-v ${PWD}:/app \
--workdir /app \
unicaen-dev-php7.0-apache \
./bin/check-compat.sh 7.0
```
## PHP 7.1
```bash
docker run \
--rm \
-v ${PWD}:/app \
--workdir /app \
unicaen-dev-php7.0-apache \
./bin/check-compat.sh 7.1
```
## PHP 7.2
```bash
docker run \
--rm \
-v ${PWD}:/app \
--workdir /app \
unicaen-dev-php7.0-apache \
./bin/check-compat.sh 7.2
```
## PHP 7.3
```bash
docker run \
--rm \
-v ${PWD}:/app \
--workdir /app \
unicaen-dev-php7.0-apache \
./bin/check-compat.sh 7.3
```
#!/usr/bin/env bash
[[ -z $1 ]] && echo "Veuillez spécifier les versions de PHP désirées (ex: 7.1 7.2 7.3)." && exit 1
DIR=$(cd `dirname $0` && pwd)
DIRNAME=$(basename ${DIR})
cd ${DIR}/..
versions=$1
phpcs="./vendor/bin/phpcs"
libdir="./vendor/unicaen"
outdir="./${DIRNAME}/reports"
mkdir -p ${outdir} #&& rm -rf ${outdir}/*
for path in ${libdir}/*
do
dirname=$(basename -- "$path")
for ver in "$1"
do
reportpath="${outdir}/compat-unicaen-${dirname}-${ver}.txt"
echo "Processing '${path}' against PHP version ${ver}"
echo "=> reporting into '${reportpath}'"
${phpcs} \
-p \
--standard=PHPCompatibility \
--runtime-set testVersion ${ver} \
--report-full=${reportpath} \
${path}
done
done
#!/usr/bin/env bash
[[ -z $1 ]] && echo "Veuillez spécifier la version de PHP désirée (ex: 7.2)." && exit 1
DIR=$(cd `dirname $0` && pwd)
v=$1
unicaenlogfile=/tmp/phan-unicaen-${v}.log
vendorslogfile=/tmp/phan-vendors-${v}.log
DIR=$(cd `dirname $0` && pwd)
docker-compose -f ${DIR}/../docker-compose.yml build
docker exec \
unicaen-php-compat-${v}-container \
vendor/bin/phan \
--config-file .phan/config-unicaen.php \
--target-php-version ${v} \
> ${unicaenlogfile}
docker exec \
unicaen-php-compat-${v}-container \
vendor/bin/phan \
--config-file .phan/config-vendor.php \
--target-php-version ${v} \
> ${unicaenlogfile}
echo
echo "See ${unicaenlogfile}."
echo "See ${vendorslogfile}."
echo
...@@ -15,20 +15,15 @@ PHP_VERSION_ID=$((a[0]*10000+a[1]*100+a[2])) ...@@ -15,20 +15,15 @@ PHP_VERSION_ID=$((a[0]*10000+a[1]*100+a[2]))
phpcs="./vendor/bin/phpcs" phpcs="./vendor/bin/phpcs"
libdir="./vendor/unicaen" libdir="./vendor/unicaen"
reportpath="/tmp/unicaen-${version}.log"
echo "" > ${reportpath}
for path in ${libdir}/* for path in ${libdir}/*
do do
dirname=$(basename -- "$path") dirname=$(basename -- "$path")
echo "Processing '${path}' against PHP version ${version} (PHP_VERSION_ID=${PHP_VERSION_ID})" echo "Processing '${path}' against PHP version ${version} (PHP_VERSION_ID=${PHP_VERSION_ID})"
echo
${phpcs} \ ${phpcs} \
-p \ -p \
--standard=PHPCompatibility \ --standard=PHPCompatibility \
--runtime-set php_version ${PHP_VERSION_ID} \ --runtime-set php_version ${PHP_VERSION_ID} \
--report-full ${reportpath} \
${path} ${path}
done done
echo "Done. See '${reportpath}'."
#!/usr/bin/env bash
[[ -z $1 ]] && echo "Veuillez spécifier la version de PHP désirée (ex: 7.2)." && exit 1
DIR=$(cd `dirname $0` && pwd)
v=$1
imagename="unicaen-php-compat-${v}"
containername=${imagename}-container
unicaenlogfile="/tmp/unicaen-php-compat-phan-unicaen-${v}.log"
vendorslogfile="/tmp/unicaen-php-compat-phan-vendors-${v}.log"
DIR=$(cd `dirname $0` && pwd)
echo "==================================================================================="
echo " Construction de l'image ${imagename}"
echo "==================================================================================="
docker-compose -f vendor/unicaen/php-compat/docker-compose.yml build ${imagename}
[[ $? != 0 ]] && echo "Erreur bloquante, ciao." && exit 1
echo
echo "==================================================================================="
echo " Composer update dans le container ${containername}"
echo "==================================================================================="
docker exec ${containername} composer update --no-suggest --no-scripts
[[ $? != 0 ]] && echo "Erreur bloquante, ciao." && exit 1
echo
echo "==================================================================================="
echo " Analyse PHAN des modules unicaen/* installés"
echo " (cf. vendor/unicaen/php-compat/.phan/config-unicaen.php)"
echo "==================================================================================="
docker exec \
${containername} \
vendor/phan/phan/phan \
--config-file .phan/config-unicaen.php \
--target-php-version ${v} \
> ${unicaenlogfile}
echo "See '${unicaenlogfile}'."
echo
echo "==================================================================================="
echo " Analyse PHAN des principaux vendors installés"
echo " (cf. vendor/unicaen/php-compat/.phan/config-vendor.php)"
echo "==================================================================================="
docker exec \
${containername} \
vendor/phan/phan/phan \
--config-file .phan/config-vendor.php \
--target-php-version ${v} \
> ${vendorslogfile}
echo "See '${vendorslogfile}'."
echo
#!/usr/bin/env bash
[[ -z $1 ]] && echo "Veuillez spécifier la version de PHP désirée (ex: 7.2)." && exit 1
DIR=$(cd `dirname $0` && pwd)
v=$1
imagename="unicaen-php-compat-${v}"
containername=${imagename}-container
unicaenlogfile="/tmp/unicaen-php-compat-phpcs-unicaen-${v}.log"
vendorslogfile="/tmp/unicaen-php-compat-phpcs-vendors-${v}.log"
DIR=$(cd `dirname $0` && pwd)
echo "==================================================================================="
echo " Construction de l'image ${imagename}"
echo "==================================================================================="
docker-compose -f vendor/unicaen/php-compat/docker-compose.yml build ${imagename}
[[ $? != 0 ]] && echo "Erreur bloquante, ciao." && exit 1
echo
echo "==================================================================================="
echo " Composer update dans le container ${containername}"
echo "==================================================================================="
docker exec ${containername} composer update --no-suggest --no-scripts
[[ $? != 0 ]] && echo "Erreur bloquante, ciao." && exit 1
echo
echo "==================================================================================="
echo " Analyse PHPCS des modules unicaen/* installés"
echo "==================================================================================="
docker exec ${containername} vendor/unicaen/php-compat/bin/phpcs.sh ${v} > ${unicaenlogfile}
echo "See '${unicaenlogfile}'."
#echo
#echo "==================================================================================="
#echo " Analyse PHPCS des principaux vendors installés"
#echo "==================================================================================="
#docker exec ${containername} vendor/unicaen/php-compat/bin/phpcs.sh ${v} > ${unicaenlogfile}
#echo "See '${unicaenlogfile}'."
echo
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
"phan/phan": "^1.2" "phan/phan": "^1.2"
}, },
"bin": [ "bin": [
"bin/php-compat-build.sh", "bin/unicaen-php-compat-run-phan",
"bin/php-compat-run.sh" "bin/unicaen-php-compat-run-phpcs"
], ],
"scripts": { "scripts": {
}, },
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment