diff --git a/Yavsc/Makefile b/Yavsc/Makefile index e63956ab..e3445b65 100644 --- a/Yavsc/Makefile +++ b/Yavsc/Makefile @@ -1,6 +1,15 @@ DESTDIR=/srv/www/yavscpre PRODDESTDIR=/srv/www/yavsc +git_status := $(shell git status -s --porcelain |wc -l) + +status: +ifeq ($(git_status),0) + @echo Nothing to be done. +else + @git status +endif + default: pushInPre watch: @@ -27,16 +36,13 @@ pushInPre: bin/output/wwwroot/version ssh root@localhost systemctl start kestrel-pre pushInProd: bin/output/wwwroot/version +ifeq ($(git_status),0) ssh root@localhost systemctl stop kestrel ssh root@localhost rm -rf $(PRODDESTDIR)/approot (cd bin/output && rsync -ravu ./ root@localhost:$(PRODDESTDIR) >/dev/null) ssh root@localhost sync ssh root@localhost systemctl start kestrel - -status: -ifeq ($(git status -s --porcelain |wc -l),0) - @echo oui else - @echo non + @echo Err! Refus de pousser en production: des changements doivent être validés auprès du contrôle de versions. + @git status endif -