Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add a Makefile to support Docker operations
- Loading branch information
1 parent
36fc9da
commit d549dce
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
GREEN := \033[1;32m | ||
BLUE := \033[1;34m | ||
RESET := \033[0m | ||
|
||
# The directory of this file | ||
DIR := $(shell echo $(shell cd "$(shell dirname "${BASH_SOURCE[0]}" )" && pwd )) | ||
|
||
# This will output the help for each task | ||
# thanks to https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html | ||
.PHONY: help | ||
|
||
help: ## This help | ||
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "${GREEN}%-30s${RESET} %s\n", $$1, $$2}' $(MAKEFILE_LIST) | ||
|
||
.DEFAULT_GOAL := help | ||
|
||
serve: ## Local server | ||
@echo "${BLUE}Servering website in localhost:4000${RESET}" | ||
docker run -p 4000:4000 -v $(DIR):/usr/src/app my-jekyll-project | ||
|
||
build: ## Build site | ||
@echo "${BLUE}Building site...${RESET}" | ||
docker build -t expressjs.com . | ||
|
||
clean: ## Clean up | ||
@echo "${BLUE}Clean up...${RESET}" | ||
docker rmi expressjs.com |