|
# HELP |
|
# This will output the help for each task |
|
# thanks to https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html |
|
.PHONY: help |
|
|
|
RANDOM := $(shell /bin/bash -c "cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 6 | head -n 1") |
|
|
|
help: ## This help. |
|
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) |
|
|
|
.DEFAULT_GOAL := help |
|
|
|
ENV ?= local |
|
|
|
start: ## Run in local development mode |
|
@echo "Starting development server..." |
|
@docker-compose up -d --build |
|
@echo |
|
@echo "run 'make stop' to shutdown your dev environment" |
|
|
|
shell: ## get a shell on your running dev environment |
|
@echo "This will give you a local shell in your dev environment" |
|
@docker-compose exec dev bash |
|
|
|
test: ## Run unit testing |
|
@echo "This is the unit tests you should have..." |
|
@echo "please implement me" |
|
#@docker-compose exec dev npm run test |
|
|
|
stop: ## Stop a running dev environment |
|
@echo "Stopping your development environment" |
|
@docker-compose down --remove-orphans |
|
|
|
build: ## Build Hugo site ready to be published |
|
@echo "Building site ready to be published" |
|
@docker-compose run --rm build |
|
|
|
pub: build ## rsync to production |
|
@echo "Publishing to production (hdb)" |
|
@rsync -avz --delete site/ my_droplet.digtialocean.com:sites/example.com/ |
|
|
|
change: ## create a new changelog entry |
|
@echo "Creating a new changelog entry" |
|
@docker-compose run build new content/en/changelog/2023/$(RANDOM).md |
|
|
|
blog: ## create a new blog post |
|
@echo "Creating a new blog post" |
|
@docker-compose run build new content/en/blog/2023/$(RANDOM).md |
|
|
|
re: stop start ## restart local dev |