Feat: import DEV settings to Makefile

This commit is contained in:
Bertrand Benjamin 2020-06-26 11:04:49 +02:00
parent ebd73f39f5
commit 380a16c158

View File

@ -2,6 +2,7 @@ PY?=python3
PELICAN?=pelican PELICAN?=pelican
PELICANOPTS= PELICANOPTS=
YEARSUBFOLDER=
BASEDIR=$(CURDIR) BASEDIR=$(CURDIR)
INPUTDIR=$(BASEDIR)/content INPUTDIR=$(BASEDIR)/content
OUTPUTDIR=$(BASEDIR)/output OUTPUTDIR=$(BASEDIR)/output
@ -13,7 +14,6 @@ FAKEDIR=../output/
SSH_HOST=Embrevade SSH_HOST=Embrevade
SSH_PORT=22 SSH_PORT=22
SSH_USER=sshcontent SSH_USER=sshcontent
SSH_TARGET_DIR=/var/www
SSH_TARGET_DIR=/home/sshcontent/opytex.org/www/ SSH_TARGET_DIR=/home/sshcontent/opytex.org/www/
RSYNC_EXCLUDE=--exclude "pymath" --exclude "opytex" --exclude "enseignements" RSYNC_EXCLUDE=--exclude "pymath" --exclude "opytex" --exclude "enseignements"
@ -23,7 +23,7 @@ ifeq ($(DEBUG), 1)
PELICANOPTS += -D PELICANOPTS += -D
endif endif
RELATIVE ?= 0 RELATIVE ?= 1
ifeq ($(RELATIVE), 1) ifeq ($(RELATIVE), 1)
PELICANOPTS += --relative-urls PELICANOPTS += --relative-urls
endif endif
@ -47,6 +47,7 @@ help:
@echo ' ' @echo ' '
html: html:
lessc $(BASEDIR)/theme/static/stylesheet/style.less $(BASEDIR)/theme/static/stylesheet/style.min.css -x
$(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS) $(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS)
clean: clean:
@ -80,16 +81,13 @@ endif
publish: publish:
$(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(PUBLISHCONF) $(PELICANOPTS) $(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(PUBLISHCONF) $(PELICANOPTS)
ssh_upload: publish
#scp -P $(SSH_PORT) -r $(OUTPUTDIR)/* $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR)
scp -r $(OUTPUTDIR)/* $(SSH_HOST):$(SSH_TARGET_DIR)
rsync_upload: publish rsync_upload: publish
#rsync -e "ssh -p $(SSH_PORT)" -P -rvzc --cvs-exclude --delete $(OUTPUTDIR)/ $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR) #rsync -e "ssh -p $(SSH_PORT)" -P -rvzc --cvs-exclude --delete $(OUTPUTDIR)/ $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR)
rsync -e "ssh" -P -rvzc --delete $(RSYNC_EXCLUDE) $(OUTPUTDIR)/ $(SSH_HOST):$(SSH_TARGET_DIR) --cvs-exclude rsync -e "ssh" -P -rvzc --delete $(RSYNC_EXCLUDE) $(OUTPUTDIR)/ $(SSH_HOST):$(SSH_TARGET_DIR) --cvs-exclude
fake_upload: html fake_upload: html
mkdir -p $(FAKEDIR) mkdir -p $(FAKEDIR)$(YEARSUBFOLDER)
rsync -P -rvzc --delete $(RSYNC_EXCLUDE) $(OUTPUTDIR)/ $(FAKEDIR) --cvs-exclude rsync -P -rvzc --delete $(OUTPUTDIR)/ $(FAKEDIR)$(YEARSUBFOLDER) --cvs-exclude
.PHONY: html help clean regenerate serve serve-global devserver publish ssh_upload rsync_upload .PHONY: html help clean regenerate serve serve-global devserver publish ssh_upload rsync_upload