forked from faktaoklimatu/web-cz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
65 lines (50 loc) · 1.84 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
INFOGRAPHICS_FOLDER=assets/infographics
INFOGRAPHICS_SRC=$(wildcard _infografiky/*/*.pdf)
INFOGRAPHICS_DST=$(addprefix $(INFOGRAPHICS_FOLDER)/,$(notdir $(INFOGRAPHICS_SRC)))
DATASETS_FOLDER=assets/datasets
DATASETS_SRC=$(wildcard _datasety/*.md)
DATASETS_DST=$(addprefix $(DATASETS_FOLDER)/,$(notdir $(DATASETS_SRC:.md=.png)))
STUDIES_FOLDER=assets/studies
STUDIES_SRC=$(wildcard _studie/*.jpg _studie/*.png)
STUDIES_DST=$(addprefix $(STUDIES_FOLDER)/,$(notdir $(STUDIES_SRC)))
PODMAN=podman
CONTAINER_IMAGE=faktaoklimatu/web
CONTAINER_NAME=faktaoklimatu
all: web
# Phony targets for container management.
container:
if $(PODMAN) inspect $(CONTAINER_NAME) >/dev/null 2>&1 ; \
then $(PODMAN) start -a $(CONTAINER_NAME) ||: ; \
else make build-container; fi
build-container:
$(PODMAN) build --file Dockerfile --tag $(CONTAINER_IMAGE) .
$(PODMAN) run --interactive --tty --name $(CONTAINER_NAME) \
--volume $$PWD:/srv/jekyll --publish 4000:4000 $(CONTAINER_IMAGE) ||:
delete-container:
$(PODMAN) rm --force $(CONTAINER_NAME)
# Targets for generating files and managing the Jekyll site.
reinstall:
-rm Gemfile.lock
bundle install
local: web
[ -f Gemfile.lock ] || bundle install
bundle exec jekyll serve --trace
web: $(INFOGRAPHICS_DST) $(STUDIES_DST) # $(DATASETS_DST)
check: web
@echo "Building the website using Jekyll ..."
bundle exec jekyll build
@echo "Running tests on the generated site using html-proofer ..."
-bundle exec ruby utils/test.rb
clean:
rm -rf $(INFOGRAPHICS_FOLDER)
rm -rf $(STUDIES_FOLDER)
$(INFOGRAPHICS_FOLDER)/%.pdf: _infografiky/*/%.pdf
@utils/convert-infographic.sh $< $@
$(STUDIES_FOLDER)/%: _studie/%
mkdir -p $(@D)
cp $< $@
dataset-images: $(DATASETS_DST)
$(DATASETS_FOLDER)/%.png: _datasety/%.md
@bash utils/download-dataset-preview.sh $< $@
.PHONY: all web local clean
.PHONY: container build-container delete-container