Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9d8fadad60
|
@@ -1,36 +1,42 @@
|
|||||||
.PHONY: build events dev stop help prep lint format
|
.PHONY: build events dev stop help prep lint format
|
||||||
|
|
||||||
help:
|
requirements += python3
|
||||||
@echo "Available commands:"
|
requirements += nginx
|
||||||
@echo " make prep - Create venv and install requirements"
|
|
||||||
@echo " make events - Update site from CSV (build pages + images)"
|
|
||||||
@echo " make dev - Start development server"
|
|
||||||
@echo " make stop - Stop development server"
|
|
||||||
@echo " make build - Full website build sequence"
|
|
||||||
@echo " make help - Show this help message"
|
|
||||||
|
|
||||||
prep:
|
help:
|
||||||
|
@awk 'BEGIN {FS = ":.*?## "} /^[0-9a-zA-Z._-]+:.*?## / {printf "\033[36m%s\033[0m : %s\n", $$1, $$2}' $(MAKEFILE_LIST) | sort | column -s ':' -t
|
||||||
|
|
||||||
|
.PHONY: check
|
||||||
|
check: ## Check you have the required dependencies
|
||||||
|
@$(foreach dep, $(requirements), type $(dep) >/dev/null || echo "Install $(dep)." ; )
|
||||||
|
|
||||||
|
prep: ## Create venv and install requirements
|
||||||
python3 -m venv .venv
|
python3 -m venv .venv
|
||||||
./.venv/bin/pip install --upgrade pip
|
./.venv/bin/pip install --upgrade pip
|
||||||
./.venv/bin/pip install -r requirements.txt
|
./.venv/bin/pip install -r requirements.txt
|
||||||
|
|
||||||
build:
|
build: ## Full website build sequence
|
||||||
./.venv/bin/python atom_gen.py
|
./.venv/bin/python atom_gen.py
|
||||||
./.venv/bin/python prep.py
|
./.venv/bin/python prep.py
|
||||||
./.venv/bin/python build_pages.py
|
./.venv/bin/python build_pages.py
|
||||||
|
|
||||||
events:
|
events: ## Update site from CSV (build pages + images)
|
||||||
./.venv/bin/python build_pages.py
|
./.venv/bin/python build_pages.py
|
||||||
./.venv/bin/python image_poster.py
|
./.venv/bin/python image_poster.py
|
||||||
|
|
||||||
dev:
|
dev: ## Start development server
|
||||||
nginx -p . -c nginx.dev.conf
|
nginx -p . -c nginx.dev.conf
|
||||||
|
|
||||||
stop:
|
stop:
|
||||||
nginx -p . -c nginx.dev.conf -s stop
|
nginx -p . -c nginx.dev.conf -s stop
|
||||||
|
|
||||||
lint:
|
lint: ## Check syntax
|
||||||
./.venv/bin/flake8 . --config .flake8 --exclude .venv
|
./.venv/bin/flake8 . --config .flake8 --exclude .venv
|
||||||
|
|
||||||
format:
|
format:
|
||||||
./.venv/bin/black .
|
./.venv/bin/black .
|
||||||
|
|
||||||
|
.PHONY: clean
|
||||||
|
clean: ## Remove generated files.
|
||||||
|
$(RM) $(defaults)
|
||||||
|
|
||||||
Reference in new issue
Block a user