- Issues should be filed at https://www.drupal.org/project/issues/vercel_deploy
- Pull requests can be made against https://github.com/antistatique/drupal-vercel-deploy/pulls
Drupal repo
$ git remote add drupal [email protected]:project/vercel_deploy.git
Github repo
$ git remote add github [email protected]:antistatique/drupal-vercel-deploy.git
First of all, you will need to have the following tools installed globally on your environment:
- drush
- Latest dev release of Drupal 9.x/10.x.
- docker
- docker compose
Once run, you will be able to access to your fresh installed Drupal on
http://localhost:8888/
.
docker compose build --pull --build-arg BASE_IMAGE_TAG=10.2 drupal
# (get a coffee, this will take some time...)
docker compose up -d drupal
docker compose exec -u www-data drupal drush site-install standard \
--db-url="mysql://drupal:drupal@db/drupal" -y
# You may be interesed by reseting the admin passowrd of your Docker and
# install the module using those cmd.
docker compose exec drupal drush user:password admin admin
docker compose exec drupal drush en vercel_deploy -y
We use the Docker for Drupal Contrib images to run testing on our project.
Run testing by stopping at first failure using the following command:
docker compose exec -u www-data drupal phpunit --group=vercel_deploy \
--no-coverage --stop-on-failure --configuration=/var/www/html/phpunit.xml
During Docker build, the following Static Analyzers will be installed on the
Docker drupal
via Composer:
drupal/coder^8.3.1
(includingsquizlabs/php_codesniffer
&phpstan/phpstan
),
The following Analyzer will be downloaded & installed as PHAR:
phpmd/phpmd
sebastian/phpcpd
wapmorgan/PhpDeprecationDetector
./scripts/hooks/post-commit
# or run command on the container itself
docker compose exec drupal bash
https://github.com/squizlabs/PHP_CodeSniffer
PHP_CodeSniffer is a set of two PHP scripts; the main phpcs
script that
tokenizes PHP, JavaScript and CSS files to detect violations of a defined coding
standard, and a second phpcbf
script to automatically correct coding standard
violations.
PHP_CodeSniffer is an essential development tool that ensures your code remains
clean and consistent.
$ docker compose exec drupal ./vendor/bin/phpcs \
./web/modules/contrib/vercel_deploy/
Automatically fix coding standards
$ docker compose exec drupal ./vendor/bin/phpcbf \
./web/modules/contrib/vercel_deploy/
https://github.com/phpmd/phpmd
Detect overcomplicated expressions & Unused parameters, methods, properties.
$ docker compose exec drupal phpmd ./web/modules/contrib/vercel_deploy/ text \
./phpmd.xml \
--suffixes php,module,inc,install,test,profile,theme,css,info,txt \
--exclude *Test.php,*vendor/*
https://github.com/sebastianbergmann/phpcpd
phpcpd
is a Copy/Paste Detector (CPD) for PHP code.
$ docker compose exec drupal phpcpd ./web/modules/contrib/vercel_deploy/src \
--suffix .php --suffix .module --suffix .inc --suffix .install --suffix .test \
--suffix .profile --suffix .theme --suffix .css --suffix .info --suffix .txt \
--exclude *.md --exclude *.info.yml --exclude tests --exclude vendor/
https://github.com/wapmorgan/PhpDeprecationDetector
A scanner that checks compatibility of your code with PHP interpreter versions.
$ docker compose exec drupal phpdd ./web/modules/contrib/vercel_deploy/ \
--file-extensions php,module,inc,install,test,profile,theme,info \
--exclude vendor
Maintaining code quality by adding the custom post-commit hook to yours.
cat ./scripts/hooks/post-commit >> ./.git/hooks/post-commit