Commit e97d2bb5 authored by Caleb Maclennan's avatar Caleb Maclennan
Browse files

Setup book bulids by mashing into CaSILE's expectations

parent fcb6b835
......@@ -28,7 +28,6 @@ stats:
artifacts:
paths:
- '*.pdf'
allow_failure: true
script:
- make $CI_JOB_NAME
course_en:
......@@ -39,3 +38,23 @@ course_tr:
extends: .course
variables:
LANGUAGE: tr
.book:
stage: build
tags:
- casile
only:
variables:
- $CI_PROJECT_NAME =~ /book_.*/
artifacts:
paths:
- '*.pdf'
script:
- make $CI_JOB_NAME
book_en:
extends: .book
variables:
LANGUAGE: en
book_tr:
extends: .book
variables:
LANGUAGE: tr
......@@ -102,6 +102,8 @@ ifneq ($(strip $(CCMCOURSECODE)),)
POSTCASILEINCLUDE += $(CCMTOOLKITDIR)/makefile-course
endif
ifneq ($(strip $(CCMBOOKCODE)),)
BOOKBASE = $(_book)_$(CCMBOOKCODE)
SOURCES += $(BOOKBASE)
POSTCASILEINCLUDE += $(CCMTOOLKITDIR)/makefile-book
endif
......
THISBOOK = book_$(LANGUAGE)
all: $(THISBOOK)
.PHONY: $(THISBOOK)
$(THISBOOK): $(BOOKBASE)
$(BOOKBASE).md: $(LANGUAGE)/$(CCMBOOKCODE).md
cp $< $@
$(CCMTOOLKITDIR)/meta-json.tpl:
echo '$$meta-json$$' > $@
# CaSILE doesn't expect to have to generate this by defaulat
$(BOOKBASE)-manifest.yml: $(BOOKBASE).yml
$(BOOKBASE).yml: $(LANGUAGE)/$(CCMBOOKCODE).md $(CCMTOOLKITDIR)/meta-json.tpl
$(PANDOC) $(PANDOCARGS) \
--template $(CCMTOOLKITDIR)/meta-json.tpl \
$< |
yq -M -e -y '.' > $@
THISCOURSE = course_$(LANGUAGE)
# Describe IIIM/BTS CCM courses in a way we can iterate over in make
LESSONS := $(subst $(_lesson)-,,$(basename $(notdir $(wildcard $(LANGUAGE)/$(_lesson)-[0-9]*.md))))
THISCOURSE = course_$(LANGUAGE)
all: $(THISCOURSE)
FILTEREDLESSONS = $(call pattern_list,$(_lesson),$(LESSONS),$(call localize,$(LESSONFILTERS)),.md)
......
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