2021-10-29 01:24:43 +09:00
|
|
|
|
2021-08-06 20:14:03 +09:00
|
|
|
DIR=$(strip $(notdir $(CURDIR))) # Seems a bit hack-ish, but `basename` works differently
|
2021-05-02 21:39:32 +09:00
|
|
|
|
2021-10-18 23:20:50 +09:00
|
|
|
translate-container-name = $$(if docker container inspect $(1) > /dev/null 2>&1; then echo $(1); else echo $(1) | sed 'y/_/-/' ; fi)
|
2021-10-29 01:24:43 +09:00
|
|
|
args = `arg="$(filter-out $@,$(MAKECMDGOALS))" && echo $${arg:-${1}}`
|
|
|
|
|
|
|
|
%:
|
|
|
|
@:
|
2021-10-18 23:20:50 +09:00
|
|
|
|
2021-08-06 20:14:03 +09:00
|
|
|
.PHONY:
|
2021-08-19 01:25:23 +09:00
|
|
|
@if ! docker info > /dev/null; then echo "Docker does not seem to be running"; exit 1; fi
|
2021-08-06 20:14:03 +09:00
|
|
|
|
|
|
|
up: .PHONY
|
|
|
|
docker-compose up -d
|
|
|
|
|
|
|
|
down: .PHONY
|
|
|
|
docker-compose down
|
|
|
|
|
2021-08-17 06:07:24 +09:00
|
|
|
redis-shell:
|
2021-10-18 23:20:50 +09:00
|
|
|
docker exec -it $(call translate-container-name,$(strip $(DIR))_redis_1) sh -c 'redis-cli'
|
2021-08-17 06:07:24 +09:00
|
|
|
|
2021-08-06 20:14:03 +09:00
|
|
|
php-repl: .PHONY
|
2021-10-18 23:20:50 +09:00
|
|
|
docker exec -it $(call translate-container-name,$(strip $(DIR))_php_1) sh -c '/var/www/social/bin/console psysh'
|
2021-08-06 20:14:03 +09:00
|
|
|
|
|
|
|
php-shell: .PHONY
|
2021-10-18 23:20:50 +09:00
|
|
|
docker exec -it $(call translate-container-name,$(strip $(DIR))_php_1) sh -c 'cd /var/www/social; sh'
|
2021-08-06 20:14:03 +09:00
|
|
|
|
|
|
|
psql-shell: .PHONY
|
2021-10-18 23:20:50 +09:00
|
|
|
docker exec -it $(call translate-container-name,$(strip $(DIR))_db_1) sh -c "psql -U postgres social"
|
2021-08-06 20:14:03 +09:00
|
|
|
|
2021-11-02 19:40:01 +09:00
|
|
|
database-force-nuke:
|
|
|
|
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"
|
|
|
|
|
2021-08-17 06:07:24 +09:00
|
|
|
database-force-schema-update:
|
2021-10-18 23:20:50 +09:00
|
|
|
docker exec -it $(call translate-container-name,$(strip $(DIR))_php_1) sh -c "/var/www/social/bin/console doctrine:schema:update --dump-sql --force"
|
2021-08-17 06:07:24 +09:00
|
|
|
|
2021-09-09 08:40:34 +09:00
|
|
|
tooling-docker: .PHONY
|
|
|
|
@cd docker/tooling && docker-compose up -d > /dev/null 2>&1
|
2021-05-02 23:49:34 +09:00
|
|
|
|
2021-09-09 08:40:34 +09:00
|
|
|
test: tooling-docker
|
2021-10-29 01:24:43 +09:00
|
|
|
docker exec $(call translate-container-name,tooling_php_1) /var/tooling/coverage.sh $(call args,'.*')
|
2021-09-09 08:40:34 +09:00
|
|
|
|
2021-10-21 22:44:21 +09:00
|
|
|
doc-check:
|
|
|
|
bin/php-doc-check src components plugins
|
|
|
|
|
2021-09-09 08:40:34 +09:00
|
|
|
phpstan: tooling-docker
|
2021-10-21 23:11:00 +09:00
|
|
|
bin/phpstan
|
2021-09-09 08:40:34 +09:00
|
|
|
|
|
|
|
stop-tooling: .PHONY
|
|
|
|
cd docker/tooling && docker-compose down
|