42 lines
1.1 KiB
Makefile
42 lines
1.1 KiB
Makefile
VERBOSE := false
|
|
export VERBOSE
|
|
GIT_UNPUSHED := $(shell git log --pretty=format:'%h' @{u}.. | wc -c)
|
|
GIT_UNTRACKED := $(shell git status | grep -i untracked -c)
|
|
GIT_NEW := $(shell git status | grep "new file" -c)
|
|
GIT_MODIFIED := $(shell git status | grep modified -c)
|
|
|
|
all: lime2test cours procedures index
|
|
|
|
lime2test:
|
|
@[ "${HOSTNAME}" != lime2 ]
|
|
|
|
cours: lime2test
|
|
@./bin/pull-cours.sh
|
|
|
|
procedures: lime2test header.html footer.html procedures/index.template.html
|
|
@./bin/pull-procedures.sh
|
|
|
|
index: lime2test header.html footer.html index.template.html
|
|
@./bin/create-index.sh
|
|
|
|
serve:
|
|
@python -m http.server
|
|
|
|
upload:
|
|
ifneq ($(GIT_UNPUSHED), 0)
|
|
@echo You have unpushed changes
|
|
@exit 1
|
|
endif
|
|
ifneq ($(GIT_UNTRACKED), 0)
|
|
@echo You have untracked files, perhaps you forgot to commit?
|
|
@exit 1
|
|
endif
|
|
ifneq ($(GIT_NEW), 0)
|
|
@echo You have new files, perhaps you forgot to commit?
|
|
@exit 1
|
|
endif
|
|
ifneq ($(GIT_MODIFIED), 0)
|
|
@echo You have modified files, perhaps you forgot to commit?
|
|
@exit 1
|
|
endif
|
|
@ssh tunuifranken.info 'cd /var/www/tunuifranken.info && sudo -u tunuifranken git pull'
|