Oliver Davies
208d535d95
Add `pull-from-prod` to the Makefile, which downloads a database from production, imports it and runs the post-import steps. Fixes #79
47 lines
1.2 KiB
Makefile
47 lines
1.2 KiB
Makefile
SHELL=/bin/bash -e -o pipefail
|
|
|
|
.PHONY: *
|
|
|
|
phpcs:
|
|
symfony php vendor/bin/phpcs -n \
|
|
--standard="Drupal,DrupalPractice" \
|
|
--extensions="php,module,inc,install,test,profile,theme" \
|
|
--ignore=*/tests/* \
|
|
--exclude="Drupal.Commenting.ClassComment,Drupal.Commenting.FunctionComment" \
|
|
web/modules/custom
|
|
|
|
symfony php vendor/bin/phpcs -n \
|
|
--standard="Drupal,DrupalPractice" \
|
|
--extensions="php,module,inc,install,test,profile,theme" \
|
|
--exclude="Drupal.Commenting.ClassComment,Drupal.Commenting.DocComment,Drupal.Commenting.FunctionComment,Drupal.NamingConventions.ValidFunctionName" \
|
|
web/modules/custom/**/tests
|
|
|
|
phpstan:
|
|
vendor/bin/phpstan analyze
|
|
|
|
phpunit:
|
|
vendor/bin/phpunit web/modules/custom
|
|
|
|
pull-from-prod:
|
|
# Download and import the database.
|
|
ansible-playbook tools/ansible/download-database.yml
|
|
zcat < dump.sql.gz | bin/drush.sh sql-cli
|
|
rm dump.sql.gz
|
|
|
|
# Post import steps.
|
|
bin/drush.sh sql-sanitize -y --sanitize-password=password
|
|
bin/drush.sh updatedb -y
|
|
bin/drush.sh cache-rebuild
|
|
bin/drush.sh user-login 1
|
|
|
|
start:
|
|
docker-compose up -d
|
|
symfony server:start -d
|
|
|
|
stop:
|
|
symfony server:stop
|
|
docker-compose down
|
|
|
|
test: phpstan phpunit phpcs
|
|
|