yavsc/Yavsc/Makefile

53 lines
1.3 KiB
Makefile

7 years ago
DESTDIR=/srv/www/yavscpre
PRODDESTDIR=/srv/www/yavsc
7 years ago
ASPNET_ENV=Development
7 years ago
git_status := $(shell git status -s --porcelain |wc -l)
status:
ifeq ($(git_status),0)
@echo Nothing to be done.
else
@git status
endif
7 years ago
default: pushInPre
watch:
7 years ago
@ASPNET_ENV=$(ASPNET_ENV) dnx-watch web --configuration=Debug
run:
@ASPNET_ENV=$(ASPNET_ENV) dnx web --configuration=Debug
7 years ago
clean:
7 years ago
@rm -rf bin/Release
@rm -rf bin/output
7 years ago
bin/Release:
7 years ago
@dnu build --configuration=Release
7 years ago
bin/output: bin/Release
7 years ago
@dnu publish
7 years ago
bin/output/wwwroot/version: bin/output
7 years ago
@git log -1 --pretty=format:%h > bin/output/wwwroot/version
7 years ago
pushInPre: bin/output/wwwroot/version
ssh root@localhost systemctl stop kestrel-pre
ssh root@localhost rm -rf $(DESTDIR)/approot
(cd bin/output && rsync -ravu ./ root@localhost:$(DESTDIR) >/dev/null)
ssh root@localhost sync
ssh root@localhost systemctl start kestrel-pre
7 years ago
7 years ago
pushInProd: bin/output/wwwroot/version
ifeq ($(git_status),0)
7 years ago
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
7 years ago
else
@echo Err! Refus de pousser en production: des changements doivent être validés auprès du contrôle de versions.
7 years ago
git status
7 years ago
endif