Add Makefile

This commit is contained in:
Daniel_I_Am 2022-05-28 11:16:22 +02:00
parent 55632a4c94
commit f0df9fae5d
3 changed files with 37 additions and 0 deletions

View File

@ -1,3 +1,4 @@
dist/
README.md
Makefile
.dockerignore

View File

@ -19,3 +19,6 @@ indent_size = 2
[docker-compose.yml]
indent_size = 4
[Makefile]
indent_style = tab

33
Makefile Normal file
View File

@ -0,0 +1,33 @@
DOCKER_REPOSITORY := daniel-website/nginx
DOCKER_TAG?="dev"
.DEFAULT_GOAL := help
.PHONY: help
help:
@printf "\033[33mUsage:\033[0m\n make [target] [arg=\"val\"...]\n\n\033[33mTargets:\033[0m\n"
@grep -E '^[-a-zA-Z0-9_\.\/]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[32m%-15s\033[0m %s\n", $$1, $$2}'
.PHONY: run
run: ## Start all docker containers using docker-compose
@docker-compose up -d
.PHONY: debug
debug: ## Start all docker containers using docker-compose. Attach to stdout
@docker-compose up
.PHONY: sh
sh: ## Start shell in docker container
@docker-compose exec vue bash
.PHONY: build-container
build-container: ## Build a release container
@docker build -t "${DOCKER_REPOSITORY}:${DOCKER_TAG}" -f docker/nginx/Dockerfile .
.PHONY: build
build: node_modules ## Build a release
@yarn build
node_modules: package.json yarn.lock
@yarn
@touch node_modules