tunuifranken.info/Makefile

41 lines
1 KiB
Makefile
Raw Normal View History

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