55 lines
1.5 KiB
Makefile
55 lines
1.5 KiB
Makefile
.DEFAULT_GOAL := help
|
|
.PHONY: live site image push run help
|
|
|
|
## live = Run zensical with live-reloading on http://localhost:8000
|
|
live:
|
|
@echo "*** Wait until container starts and open http://localhost:8000 to see live preview"
|
|
@docker stop boilerplate-docs-dev 2>/dev/null; \
|
|
docker run \
|
|
--rm \
|
|
--interactive \
|
|
--tty \
|
|
--env PYTHONPATH=/docs \
|
|
--publish 8000:8000 \
|
|
--volume ${PWD}:/docs \
|
|
--name boilerplate-docs-dev \
|
|
zensical/zensical:latest
|
|
|
|
## site = Build a local static site
|
|
site:
|
|
@echo "*** Wait until zensical finish"
|
|
@docker stop boilerplate-docs-dev 2>/dev/null; \
|
|
docker run \
|
|
--pull always \
|
|
--rm \
|
|
--env PYTHONPATH=/docs \
|
|
--volume ${PWD}:/docs \
|
|
--name boilerplate-docs-dev \
|
|
zensical/zensical:latest \
|
|
build \
|
|
--clean
|
|
|
|
## image = Build a docker image
|
|
image:
|
|
@docker build --tag harbor.example.com/boilerplate-docs:latest .
|
|
|
|
## run = Run docker container from image built with `make image` on http://localhost:8001
|
|
run:
|
|
@echo "*** Wait until container starts and open http://localhost:8001 to see ready static website"
|
|
@docker stop boilerplate-docs 2>/dev/null; \
|
|
docker run \
|
|
--rm \
|
|
--publish 8001:80 \
|
|
--name boilerplate-docs \
|
|
harbor.example.com/boilerplate-docs:latest
|
|
|
|
## push = Push docker image built with `make image` to harbor.example.com
|
|
push:
|
|
@docker login harbor.example.com; \
|
|
docker push harbor.example.com/boilerplate-docs:latest
|
|
|
|
## help = Show this message and exit (default)
|
|
help: Makefile
|
|
@echo "Available recipes:"
|
|
@sed -n 's/^##/ /p' $< | column -t -s '='
|