Added command for publishing PLFA.

This commit is contained in:
Wen Kokke 2020-10-23 11:35:48 +02:00
parent 3d4c9f7a1d
commit 5e0f54eb74

View file

@ -91,6 +91,40 @@ list:
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$'
########################################
# Publish PLFA
########################################
.PHONY: publish
publish: setup-check-rsync
@echo "Cleaning up..."
make clean
@echo "Building site..."
make build
@echo "Testing site..."
make test
@echo "Creating web branch..."
git fetch --all
git checkout -b web --track origin/web
rsync -a \
--filter='P _site/' \
--filter='P _cache/' \
--filter='P .git/' \
--filter='P .gitignore' \
--filter='P .stack-work' \
--filter='P CNAME' \
--delete-excluded \
_site/ .
git add -A
@echo "Publishing web branch..."
git commit -m "Publish."
git push origin web:web
@echo "Deleting web branch..."
git checkout dev
git branch -D web
#################################################################################
# Setup dependencies
#################################################################################
@ -135,6 +169,14 @@ ifeq (,$(wildcard $(shell which epubcheck)))
@echo "See: https://github.com/w3c/epubcheck"
endif
.PHONY: setup-check-rsync
setup-check-rsync:
ifeq (,$(wildcard $(shell which rsync)))
@echo "The command you called requires rsync"
@echo "See: https://rsync.samba.org/"
@exit 1
endif
.PHONY: setup-install-htmlproofer
setup-install-htmlproofer: setup-check-gem
ifeq (,$(wildcard $(shell which htmlproofer)))