upstream V3 development https://www.gnusocial.rocks/v3
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 
 
 
 

53 рядки
1.9 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. test: tooling-docker
  29. docker exec $(call translate-container-name,tooling_php_1) /var/tooling/coverage.sh $(call args,'')
  30. doc-check:
  31. bin/php-doc-check src components plugins
  32. phpstan: tooling-docker
  33. bin/phpstan
  34. stop-tooling: .PHONY
  35. cd docker/tooling && docker-compose down