Skip to content

Commit

Permalink
Enhance Makefile Shell Targets (#113)
Browse files Browse the repository at this point in the history
* feat: shell command enhancement

* Update Makefile

* wip

---------

Co-authored-by: mortexa <[email protected]>
  • Loading branch information
shahghasiadil and smortexa authored Jan 6, 2025
1 parent 47417c5 commit cc93ce1
Showing 1 changed file with 5 additions and 2 deletions.
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}}"

0 comments on commit cc93ce1

Please sign in to comment.