Created
December 6, 2024 19:45
-
-
Save jotapepinheiro/db895f354b3d4f5801603acfd5bc779a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PATH := $(PATH):$(PWD)/bin: | |
SHELL := /bin/bash | |
.PHONY: help | |
.DEFAULT_GOAL = help | |
phpmd := vendor/bin/phpmd | |
phpcs := vendor/bin/phpcs | |
phpcbf := vendor/bin/phpcbf | |
phpunit := vendor/bin/phpunit | |
phpstan := vendor/bin/phpstan | |
pest := vendor/bin/pest | |
CONTAINER := microservice-global-auth-server-external | |
CONTAINER_REDIS := auth-server-redis | |
PATH_CONTAINER := /var/www/html | |
## ββ Docker π³ βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
docker-start: ## Iniciar Docker | |
docker compose up -d | |
docker-build: ## Iniciar Docker com build | |
docker compose up -d --build | |
docker-stop: ## Desligar Docker | |
docker compose down | |
docker-shell: ## Acessar container do php | |
docker exec -it $(CONTAINER) sh | |
docker-rebuild-all: ## Rebuild em todos os containers | |
make docker-stop docker-build | |
reload-nginx: ## Reload no nginx | |
docker exec -it $(CONTAINER) nginx -s reload | |
redis-clear: ## Limpar cache do redis | |
docker exec -it $(CONTAINER_REDIS) redis-cli flushall | |
show-php-memory: ## Exibir memoria do PHP | |
docker exec -it $(CONTAINER) sh -c "php -i | grep memory_limit" | |
## ββ Pest π βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
pest: ## Executar testes com Pest | |
docker exec -it $(CONTAINER) sh -c "cd $(PATH_CONTAINER) \ | |
&& $(pest)" | |
coverage: ## Executar testes com Pest e gerar relatΓ³rio de cobertura | |
docker exec -it $(CONTAINER) sh -c "cd $(PATH_CONTAINER) \ | |
&& $(pest) --coverage" | |
generate-coverage: ## Gerar relatΓ³rio de cobertura | |
docker exec -it $(CONTAINER) sh -c "cd $(PATH_CONTAINER) \ | |
&& $(pest) --coverage --coverage-html ./coverage" | |
## ββ Lumen πΆ βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
composer-install: ## Instalar composer | |
docker compose run --rm $(CONTAINER) composer install --ignore-platform-reqs | |
composer-update: ## Atualizar dependencias do composer | |
docker compose run --rm $(CONTAINER) composer update --ignore-platform-reqs | |
composer-validate: ## Validar dependencias do composer | |
docker exec -it $(CONTAINER) composer validate | |
composer-show: ## Exibir pacotes do composer | |
docker exec -it $(CONTAINER) composer show -l --direct --outdated | |
pa-migrate: ## Executar Migrate | |
docker exec -it $(CONTAINER) sh -c "cd $(PATH_CONTAINER) \ | |
&& php artisan migrate" | |
pa-seed: ## Executar os Seeds | |
docker exec -it $(CONTAINER) sh -c "cd $(PATH_CONTAINER) \ | |
&& php artisan db:seed" | |
pa-migrate-fresh: ## Executar Migrate Refresh | |
docker exec -it $(CONTAINER) sh -c "cd $(PATH_CONTAINER) \ | |
&& php artisan migrate:fresh --seed" | |
pa-migrate-fresh-file: ## Executar Migrate Refresh | |
docker exec -it $(CONTAINER) sh -c "cd $(PATH_CONTAINER) \ | |
&& php artisan db:seed --class=UserTypesTableSeeder --force" | |
pa-dump-autoload: ## Limpar Lumen | |
docker exec -it $(CONTAINER) sh -c "cd $(PATH_CONTAINER) \ | |
&& composer dump-autoload \ | |
&& php artisan cache:clear" | |
pa-update-password: ## Atualizar senha do usuΓ‘rio | |
docker exec -it $(CONTAINER) sh -c "cd $(PATH_CONTAINER) \ | |
&& php artisan update:password" | |
phpstan: ## Analisar cΓ³digo PHP usando PHPSTAN (https://phpstan.org/) | |
docker exec -it $(CONTAINER) php -d memory_limit=-1 $(phpstan) analyse --level=0 app public | |
phpstan-neon: ## Analisar cΓ³digo PHP usando PHPSTAN (https://phpstan.org/) | |
docker exec -it $(CONTAINER) php -d memory_limit=-1 $(phpstan) analyse -c phpstan.neon | |
phpstan-neon-local: ## Analisar cΓ³digo PHP usando PHPSTAN (https://phpstan.org/) | |
php -d memory_limit=-1 $(phpstan) analyse -c phpstan.neon | |
## ββ Outros π οΈοΈ βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
help: ## Lista de commandos | |
@grep -E '(^[a-zA-Z_-]+:.*?##.*$$)|(^##)' $(MAKEFILE_LIST) \ | |
| awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m%-24s\033[0m %s\n", $$1, $$2}' \ | |
| sed -e 's/\[32m## /[33m/' && printf "\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment