tunuifranken.info/Makefile

40 lines
1 KiB
Makefile

unpushed=$(shell git log --pretty=format:'%h' @{u}.. | wc -c)
all: lime2test cours procedures cv index
lime2test:
@[ "${HOSTNAME}" != lime2 ]
cours: lime2test
@./bin/pull-cours.sh
procedures: lime2test header.html footer.html procedures/index.template.html
@./bin/pull-procedures.sh
cv: lime2test
@./bin/pull-cv.sh
index: lime2test header.html footer.html index.template.html
@./bin/create-index.sh
serve:
@python -m http.server
upload:
@if [ ${unpushed} -ne 0 ]; then \
echo "You have unpushed changes"; \
exit 1; \
fi
@if git status | grep -i untracked -c >/dev/null 2>&1; then \
echo "You have untracked files, perhaps you forgot to commit?"; \
exit 1; \
fi
@if git status | grep "new file" -c >/dev/null 2>&1; then \
echo "You have new files, perhaps you forgot to commit?"; \
exit 1; \
fi
@if git status | grep modified -c >/dev/null 2>&1; then \
echo "You have modified files, perhaps you forgot to commit?"; \
exit 1; \
fi
@ssh tunuifranken.info 'cd tunuifranken.info && git pull'