Import sync code dropped from CaSILE

parent 2315c5ad
......@@ -117,6 +117,14 @@ ifdef FORMATS_$(TAGNAME)
FORMATS := $(FORMATS_$(TAGNAME))
endif
# Setup target dependencies to mimic stages of a CI pipeline
ifeq ($(MAKECMDGOALS),ci)
sync_pre: init debug
pdfs renderings promotionals: sync_pre
sync_post: pdfs renderings promotionals
ci: sync_pre sync_post
endif
debug: debug_avadanlik
.PHONY: debug_avadanlik
......@@ -128,6 +136,13 @@ debug_avadanlik:
@echo TAGNAME: $(TAGNAME)
@echo OUTPATHS: $(OUTPATHS)
check_dependencies: check_dependencies_avadanlik
.PHONY: check_dependencies_avadanlik
check_dependencies_avadanlik:
hash rsync
hash nextcloudcmd
.avadanlik.lua:
cat <<- EOF > $@
CASILE.publisher = "viachristus"
......@@ -183,6 +198,22 @@ define sync_nextcloud =
nextcloudcmd -n -s $(OUTPUTDIR) $(NEXTCLOUD) 2>/dev/null
endef
.PHONY: sync_pre
sync_pre: | $(require_pubdir) $(require_outputdir)
$(call pre_sync)
$(and $(INPUTDIR),rsync -utv $(INPUTDIR)/* $(PROJECTDIR)/ ||:)
$(and $(INPUTDIR),$(foreach TARGET,$(TARGETS),rsync -utv $(INPUTDIR)/$(TARGET)/* $(PROJECTDIR)/ ||:;))
.PHONY: sync_post
sync_post: | $(require_pubdir) $(require_outputdir)
$(foreach TARGET,$(TARGETS),$(foreach OUTPATH,$(OUTPATHS),mkdir -p $(OUTPUTDIR)/$(OUTPATH);)
find $(PUBDIR) -type f \( \
-name "$(TARGET)*" \
$(and $(call printisbn,$(TARGET)),-or -name "$(call printisbn,$(TARGET))*") \
$(and $(call ebookisbn,$(TARGET)),-or -name "$(call ebookisbn,$(TARGET))*") \
\)$(foreach OUTPATH,$(OUTPATHS), -execdir rsync -ct {} $(OUTPUTDIR)/$(OUTPATH)/ \;);)
$(call post_sync)
.PHONY: website
website:
curl \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment