2021-10-28 17:24:43 +01:00
|
|
|
|
2021-08-06 12:14:03 +01:00
|
|
|
DIR=$(strip $(notdir $(CURDIR))) # Seems a bit hack-ish, but `basename` works differently
|
2021-05-02 13:39:32 +01:00
|
|
|
|
2021-10-18 15:20:50 +01:00
|
|
|
translate-container-name = $$(if docker container inspect $(1) > /dev/null 2>&1; then echo $(1); else echo $(1) | sed 'y/_/-/' ; fi)
|
2021-10-28 17:24:43 +01:00
|
|
|
args = `arg="$(filter-out $@,$(MAKECMDGOALS))" && echo $${arg:-${1}}`
|
|
|
|
|
|
|
|
%:
|
|
|
|
@:
|
2021-10-18 15:20:50 +01:00
|
|
|
|
2021-08-06 12:14:03 +01:00
|
|
|
.PHONY:
|
2021-08-18 17:25:23 +01:00
|
|
|
@if ! docker info > /dev/null; then echo "Docker does not seem to be running"; exit 1; fi
|
2021-08-06 12:14:03 +01:00
|
|
|
|
|
|
|
up: .PHONY
|
|
|
|
docker-compose up -d
|
|
|
|
|
|
|
|
down: .PHONY
|
|
|
|
docker-compose down
|
|
|
|
|
2021-08-16 22:07:24 +01:00
|
|
|
redis-shell:
|
2021-10-18 15:20:50 +01:00
|
|
|
docker exec -it $(call translate-container-name,$(strip $(DIR))_redis_1) sh -c 'redis-cli'
|
2021-08-16 22:07:24 +01:00
|
|
|
|
2021-08-06 12:14:03 +01:00
|
|
|
php-repl: .PHONY
|
2021-10-18 15:20:50 +01:00
|
|
|
docker exec -it $(call translate-container-name,$(strip $(DIR))_php_1) sh -c '/var/www/social/bin/console psysh'
|
2021-08-06 12:14:03 +01:00
|
|
|
|
|
|
|
php-shell: .PHONY
|
2021-10-18 15:20:50 +01:00
|
|
|
docker exec -it $(call translate-container-name,$(strip $(DIR))_php_1) sh -c 'cd /var/www/social; sh'
|
2021-08-06 12:14:03 +01:00
|
|
|
|
|
|
|
psql-shell: .PHONY
|
2021-10-18 15:20:50 +01:00
|
|
|
docker exec -it $(call translate-container-name,$(strip $(DIR))_db_1) sh -c "psql -U postgres social"
|
2021-08-06 12:14:03 +01:00
|
|
|
|
2021-11-02 10:40:01 +00:00
|
|
|
database-force-nuke:
|
2021-11-23 22:10:16 +00:00
|
|
|
docker stop $(call translate-container-name,$(strip $(DIR))_worker_1) \
|
|
|
|
&& 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" \
|
|
|
|
&& docker-compose up -d
|
2021-11-02 10:40:01 +00:00
|
|
|
|
2021-08-16 22:07:24 +01:00
|
|
|
database-force-schema-update:
|
2021-10-18 15:20:50 +01: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-16 22:07:24 +01:00
|
|
|
|
2021-09-09 00:40:34 +01:00
|
|
|
tooling-docker: .PHONY
|
2022-01-18 17:17:07 +00:00
|
|
|
@cd docker/tooling && docker-compose up -d --build > /dev/null 2>&1
|
2021-05-02 15:49:34 +01:00
|
|
|
|
2022-01-09 14:45:33 +00:00
|
|
|
stop-tooling: .PHONY
|
|
|
|
cd docker/tooling && docker-compose down
|
|
|
|
|
|
|
|
tooling-php-shell: tooling-docker
|
|
|
|
docker exec -it $(call translate-container-name,tooling_php_1) sh
|
|
|
|
|
2022-01-16 18:57:32 +00:00
|
|
|
test-accesibility: tooling-docker
|
2022-01-18 17:17:07 +00:00
|
|
|
cd docker/tooling && docker-compose run pa11y /accessibility.sh
|
2021-12-01 19:50:25 +00:00
|
|
|
|
2021-09-09 00:40:34 +01:00
|
|
|
test: tooling-docker
|
2021-11-08 21:49:12 +00:00
|
|
|
docker exec $(call translate-container-name,tooling_php_1) /var/tooling/coverage.sh $(call args,'')
|
2021-09-09 00:40:34 +01:00
|
|
|
|
2021-12-25 14:26:59 +00:00
|
|
|
cs-fixer: tooling-docker
|
2021-12-26 15:13:37 +00:00
|
|
|
@bin/php-cs-fixer $${CS_FIXER_FILE}
|
2021-12-25 14:26:59 +00:00
|
|
|
|
|
|
|
doc-check: tooling-docker
|
|
|
|
bin/php-doc-check
|
2021-10-21 14:44:21 +01:00
|
|
|
|
2021-09-09 00:40:34 +01:00
|
|
|
phpstan: tooling-docker
|
2021-10-21 15:11:00 +01:00
|
|
|
bin/phpstan
|
2021-09-09 00:40:34 +01:00
|
|
|
|
2021-12-23 17:31:20 +00:00
|
|
|
remove-var:
|
|
|
|
rm -rf var/*
|
|
|
|
|
2021-12-26 04:18:34 +00:00
|
|
|
remove-file:
|
2022-01-17 20:49:36 +00:00
|
|
|
sudo rm -rf file/*
|
2021-12-26 04:18:34 +00:00
|
|
|
|
2021-12-23 17:31:20 +00:00
|
|
|
flush-redis-cache:
|
|
|
|
docker exec -it $(call translate-container-name,$(strip $(DIR))_redis_1) sh -c 'redis-cli flushall'
|
|
|
|
|
2021-12-26 04:18:34 +00:00
|
|
|
force-nuke-everything: down up flush-redis-cache database-force-nuke remove-var remove-file
|