Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance Makefile Shell Targets #113

Merged
merged 3 commits into from
Jan 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ DC_RUN_ARGS = --env-file ./.env.production --profile app --profile administratio
HOST_UID=$(shell id -u)
HOST_GID=$(shell id -g)

.PHONY : help up down shell\:app stop-all ps update build restart down-up images\:list images\:clean logs\:app logs containers\:health
.PHONY : help up down shell\:app stop-all ps update build restart down-up images\:list images\:clean logs\:app logs containers\:health command\:app
.DEFAULT_GOAL : help

# This will output the help for each task. thanks to https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
Expand All @@ -32,6 +32,9 @@ down\:with-volumes: ## Stop containers and remove volumes
shell\:app: ## Start shell into app container
docker compose ${DC_RUN_ARGS} exec app sh

command\:app: ## Run a command in the app container
docker compose ${DC_RUN_ARGS} exec app sh -c "$(command)"

stop-all: ## Stop all containers
docker stop $(shell docker ps -a -q)

Expand All @@ -56,4 +59,4 @@ images\:clean: ## Remove all dangling images and images not referenced by any co
docker image prune -a

containers\:health: ## Check all containers health
docker compose ${DC_RUN_ARGS} ps --format "table {{.Name}}\t{{.Service}}\t{{.Status}}"
docker compose ${DC_RUN_ARGS} ps --format "table {{.Name}}\t{{.Service}}\t{{.Status}}"