mirror of
https://github.com/elyby/accounts.git
synced 2024-12-23 22:00:06 +05:30
Simplify the call of the php-cs-fixer
This commit is contained in:
parent
02ea7346a8
commit
f09eb86e5c
@ -24,19 +24,14 @@ test:backend:
|
||||
script:
|
||||
- export TEMP_DEV_IMAGE="${CONTAINER_IMAGE}:ci-${CI_BUILD_ID}"
|
||||
- docker build --pull -f Dockerfile-dev -t $TEMP_DEV_IMAGE .
|
||||
# https://github.com/FriendsOfPHP/PHP-CS-Fixer#using-php-cs-fixer-on-ci
|
||||
- COMMIT_RANGE="${CI_COMMIT_BEFORE_SHA}...${CI_COMMIT_SHA}"
|
||||
- CHANGED_FILES=$(git diff --name-only --diff-filter=ACMRTUXB "${COMMIT_RANGE}")
|
||||
- |
|
||||
if ! echo "${CHANGED_FILES}" | grep -qE "^(\\.php_cs(\\.dist)?|composer\\.lock)$"; then
|
||||
EXTRA_ARGS=$(printf -- '--path-mode=intersection\n--\n%s' "${CHANGED_FILES}")
|
||||
else
|
||||
EXTRA_ARGS=''
|
||||
fi
|
||||
- >
|
||||
docker run --rm
|
||||
$TEMP_DEV_IMAGE
|
||||
vendor/bin/php-cs-fixer fix -v --dry-run --stop-on-violation --using-cache=no ${EXTRA_ARGS}
|
||||
bash -c "
|
||||
rm /usr/local/etc/php/conf.d/xdebug.ini &&
|
||||
cp -r /var/www/vendor /var/www/html/vendor &&
|
||||
vendor/bin/php-cs-fixer fix -v --dry-run
|
||||
"
|
||||
- >
|
||||
docker run --rm
|
||||
--add-host=mariadb:`getent hosts mariadb | awk '{ print $1 ; exit }'`
|
||||
|
Loading…
Reference in New Issue
Block a user