upstream V3 development https://www.gnusocial.rocks/v3
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

73 lines
2.4 KiB

  1. DIR=$(strip $(notdir $(CURDIR))) # Seems a bit hack-ish, but `basename` works differently
  2. translate-container-name = $$(if docker container inspect $(1) > /dev/null 2>&1; then echo $(1); else echo $(1) | sed 'y/_/-/' ; fi)
  3. args = `arg="$(filter-out $@,$(MAKECMDGOALS))" && echo $${arg:-${1}}`
  4. %:
  5. @:
  6. .PHONY:
  7. @if ! docker info > /dev/null; then echo "Docker does not seem to be running"; exit 1; fi
  8. up: .PHONY
  9. docker-compose up -d
  10. down: .PHONY
  11. docker-compose down
  12. redis-shell:
  13. docker exec -it $(call translate-container-name,$(strip $(DIR))_redis_1) sh -c 'redis-cli'
  14. php-repl: .PHONY
  15. docker exec -it $(call translate-container-name,$(strip $(DIR))_php_1) sh -c '/var/www/social/bin/console psysh'
  16. php-shell: .PHONY
  17. docker exec -it $(call translate-container-name,$(strip $(DIR))_php_1) sh -c 'cd /var/www/social; sh'
  18. psql-shell: .PHONY
  19. docker exec -it $(call translate-container-name,$(strip $(DIR))_db_1) sh -c "psql -U postgres social"
  20. database-force-nuke:
  21. docker stop $(call translate-container-name,$(strip $(DIR))_worker_1) \
  22. && docker exec -it $(call translate-container-name,$(strip $(DIR))_php_1) sh -c "cd /var/www/social; bin/console doctrine:database:drop --force && bin/console doctrine:database:create && bin/console doctrine:schema:update --dump-sql --force && bin/console app:populate_initial_values" \
  23. && docker-compose up -d
  24. database-force-schema-update:
  25. docker exec -it $(call translate-container-name,$(strip $(DIR))_php_1) sh -c "/var/www/social/bin/console doctrine:schema:update --dump-sql --force"
  26. tooling-docker: .PHONY
  27. @cd docker/tooling && docker-compose up -d > /dev/null 2>&1
  28. stop-tooling: .PHONY
  29. cd docker/tooling && docker-compose down
  30. tooling-php-shell: tooling-docker
  31. docker exec -it $(call translate-container-name,tooling_php_1) sh
  32. acceptance-and-accessibility: tooling-docker
  33. docker exec -it $(call translate-container-name,tooling_php_1) /var/tooling/acceptance_and_accessibility.sh
  34. test: tooling-docker
  35. docker exec $(call translate-container-name,tooling_php_1) /var/tooling/coverage.sh $(call args,'')
  36. cs-fixer: tooling-docker
  37. @bin/php-cs-fixer $${CS_FIXER_FILE}
  38. doc-check: tooling-docker
  39. bin/php-doc-check
  40. phpstan: tooling-docker
  41. bin/phpstan
  42. remove-var:
  43. rm -rf var/*
  44. remove-file:
  45. rm -rf file/*
  46. flush-redis-cache:
  47. docker exec -it $(call translate-container-name,$(strip $(DIR))_redis_1) sh -c 'redis-cli flushall'
  48. force-nuke-everything: down up flush-redis-cache database-force-nuke remove-var remove-file