2020-06-01 11:38:58 +00:00
|
|
|
SHELL=/bin/bash -e -o pipefail
|
|
|
|
|
2020-06-10 11:05:17 +00:00
|
|
|
THEME_PATH:=web/themes/custom/opdavies
|
|
|
|
|
2020-05-20 19:58:06 +00:00
|
|
|
.PHONY: *
|
|
|
|
|
2020-06-10 11:05:17 +00:00
|
|
|
clean: theme-clean
|
|
|
|
|
2020-05-20 19:58:06 +00:00
|
|
|
phpcs:
|
|
|
|
symfony php vendor/bin/phpcs -n \
|
|
|
|
--standard="Drupal,DrupalPractice" \
|
|
|
|
--extensions="php,module,inc,install,test,profile,theme" \
|
2020-06-01 18:03:25 +00:00
|
|
|
--exclude="Drupal.Commenting.ClassComment,Drupal.Commenting.FunctionComment,Drupal.Commenting.VariableComment" \
|
|
|
|
web/modules/custom \
|
|
|
|
web/themes/custom
|
2020-05-20 19:58:06 +00:00
|
|
|
|
|
|
|
phpstan:
|
|
|
|
vendor/bin/phpstan analyze
|
|
|
|
|
|
|
|
phpunit:
|
|
|
|
vendor/bin/phpunit web/modules/custom
|
|
|
|
|
2020-06-01 11:38:58 +00:00
|
|
|
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
|
|
|
|
|
2020-05-20 19:58:06 +00:00
|
|
|
start:
|
|
|
|
docker-compose up -d
|
|
|
|
symfony server:start -d
|
|
|
|
|
|
|
|
stop:
|
|
|
|
symfony server:stop
|
|
|
|
docker-compose down
|
|
|
|
|
|
|
|
test: phpstan phpunit phpcs
|
|
|
|
|
2020-06-10 11:05:17 +00:00
|
|
|
theme-build: theme-install-dependencies
|
|
|
|
cd ${THEME_PATH} && npm run dev
|
|
|
|
|
|
|
|
theme-build-prod: theme-install-dependencies
|
|
|
|
bin/drush.sh opdavies:export-body-values-for-theme-purging
|
|
|
|
cd ${THEME_PATH} && npm run prod
|
|
|
|
|
|
|
|
theme-clean: ${THEME_PATH}/build ${THEME_PATH}/node_modules
|
|
|
|
rm -fr ${THEME_PATH}/build
|
|
|
|
rm -fr ${THEME_PATH}/node_modules
|
|
|
|
|
|
|
|
theme-install-dependencies: ${THEME_PATH}/package.json ${THEME_PATH}/package-lock.json
|
|
|
|
cd ${THEME_PATH} && npm install
|
|
|
|
|
|
|
|
theme-watch: theme-build
|
|
|
|
cd ${THEME_PATH} && npm run watch
|