Updated Makefile with help command

This commit is contained in:
2023-07-26 19:35:13 +00:00
parent f4076ce9c3
commit da2dc6b3ba

View File

@@ -1,5 +1,6 @@
#!make
SHELL := /bin/bash
include .env
include .version
export $(shell sed 's/=.*//' .env)
@@ -9,20 +10,25 @@ SIREN_IMAGES = $(shell docker images 'siren' -a -q)
.PHONY: help build test up down exec clean
build:
help: ## Help command
@echo
@cat Makefile | grep -E '^[a-zA-Z\/_-]+:.*?## .*$$' | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
@echo
build: ## Build the docker image
docker build -t siren:${SIREN_VERSION} .
test:
test: ## Run the docker app as a container
docker run --env-file .env -it --rm --name siren siren:${SIREN_VERSION}
up:
up: ## Start the app
docker compose up -d
down:
down: ## Stop the app
docker compose down
exec:
exec: ## Enter running docker container
docker exec -it siren bash
clean:
clean: ## Cleanup docker images
docker rmi $(SIREN_IMAGES)