diff --git a/Makefile b/Makefile index 035e7d1..31d9c72 100644 --- a/Makefile +++ b/Makefile @@ -16,34 +16,34 @@ export PROJECT_LOCATION := $(shell echo ${MAKEFILE_DIRECTORY}) ## ---------------------------------------------------------------------------- ## -env-backup: ## Backup the "mysql" volume +backup: ## Backup the "mysql" volume docker run --rm \ --volumes-from $$(docker compose ps -q mysql) \ --volume $$(pwd):/backup \ busybox sh -c "tar cvf /backup/backup.tar /var/lib/mysql" -env-build: ## Build the environment +build: ## Build the environment docker compose build --pull -env-cache: ## Flush cache in Redis +cache: ## Flush cache in Redis docker compose exec redis sh -c "redis-cli FLUSHALL" -env-logs: ## Follow logs generated by all containers +logs: ## Follow logs generated by all containers docker compose logs -f --tail=0 -env-logs-full: ## Follow logs generated by all containers from the containers creation +logs-full: ## Follow logs generated by all containers from the containers creation docker compose logs -f -env-mysql: ## Open a terminal in the "mysql" container +mysql: ## Open a terminal in the "mysql" container docker compose exec mysql sh -env-nginx: ## Open a terminal in the "nginx" container +nginx: ## Open a terminal in the "nginx" container docker compose exec -u nginx:nginx nginx sh -l -env-php: ## Open a terminal in the "php" container +php: ## Open a terminal in the "php" container docker compose exec -u www-data:www-data php bash -l -c "source ./project.sh use && /bin/bash" -env-phpl: ## Open a terminal in the "php" container and prompt source locale +phpl: ## Open a terminal in the "php" container and prompt source locale @read -p "Enter locale: " locale; \ docker compose exec -u www-data:www-data php bash -l -c "source ./project.sh use $$locale && /bin/bash" @@ -51,23 +51,23 @@ source: ## Set source with given locale @read -p "Enter locale: " locale; \ source ./project.sh use $$locale -env-ps: ## List all containers managed by the environment +ps: ## List all containers managed by the environment docker compose ps -env-purge: ## Purge all services and associated volumes +purge: ## Purge all services and associated volumes docker compose down -v mutagen sync terminate --label-selector='name==${COMPOSE_PROJECT_NAME}' -env-restart: env-stop env-start ## Restart the environment +restart: stop start ## Restart the environment -env-restore: ## Restore the "mysql" volume +restore: ## Restore the "mysql" volume docker run --rm \ --volumes-from $$(docker compose ps -q mysql) \ --volume $$(pwd):/backup \ busybox sh -c "tar xvf /backup/backup.tar var/lib/mysql/" docker compose restart mysql -env-start: ## Start the environment +start: ## Start the environment @docker compose up --detach --remove-orphans @if [[ ! "$$(mutagen sync list --label-selector='name==${COMPOSE_PROJECT_NAME}')" =~ "${COMPOSE_PROJECT_NAME}" ]]; then \ @@ -87,14 +87,14 @@ env-start: ## Start the environment sleep 10; \ done -env-stats: ## Print real-time statistics about containers ressources usage +stats: ## Print real-time statistics about containers ressources usage docker stats $(docker ps --format={{.Names}}) -env-stop: ## Stop the environment +stop: ## Stop the environment @docker compose stop @mutagen sync pause --label-selector='name==${COMPOSE_PROJECT_NAME}' -.PHONY: env-backup env-build env-cache env-logs env-logs env-mysql env-nginx env-php env-ps env-purge env-restart env-restore env-start env-stats env-stop +.PHONY: backup build cache logs logs mysql nginx php ps purge restart restore start stats stop ## ## ---------------------------------------------------------------------------- @@ -102,10 +102,10 @@ env-stop: ## Stop the environment ## ---------------------------------------------------------------------------- ## -ci: ## Continuous integration +ci: ## Run continuous integration analysis @make phpcsfixer-audit phpstan eslint stylelint -ci-fix: ## Continuous integration +ci-fix: ## Run continuous integration fixes @make phpcsfixer eslint-fix stylelint-fix phpcsfixer: ## Execute the code style analysis and fix on all PHP files