forked from pandoc/dockerfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
55 lines (49 loc) · 1.95 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
PANDOC_VERSION ?= edge
ifeq ($(PANDOC_VERSION),edge)
PANDOC_COMMIT ?= master
else
PANDOC_COMMIT ?= $(PANDOC_VERSION)
endif
# Used to specify the build context path for Docker. Note that we are
# specifying the repository root so that we can
#
# COPY latex-common/texlive.profile /root
#
# for example. If writing a COPY statement in *ANY* Dockerfile, just know that
# it is from the repository root.
makefile_dir := $(dir $(realpath Makefile))
# Keep this target first so that `make` with no arguments will print this rather
# than potentially engaging in expensive builds.
.PHONY: show-args
show-args:
@printf "PANDOC_VERSION (i.e. image version tag): %s\n" $(PANDOC_VERSION)
@printf "pandoc_commit=%s\n" $(PANDOC_COMMIT)
################################################################################
# Alpine images and tests #
################################################################################
.PHONY: alpine alpine-latex test-alpine test-alpine-latex
alpine:
docker build \
--tag pandoc/core:$(PANDOC_VERSION) \
--build-arg pandoc_commit=$(PANDOC_COMMIT) \
-f $(makefile_dir)/alpine/Dockerfile $(makefile_dir)
alpine-latex:
docker build \
--tag pandoc/latex:$(PANDOC_VERSION) \
--build-arg base_tag=$(PANDOC_VERSION) \
-f $(makefile_dir)/alpine/latex/Dockerfile $(makefile_dir)
test-alpine: IMAGE ?= pandoc/core:$(PANDOC_VERSION)
test-alpine:
IMAGE=$(IMAGE) make -C test test-core
test-alpine-latex: IMAGE ?= pandoc/latex:$(PANDOC_VERSION)
test-alpine-latex:
IMAGE=$(IMAGE) make -C test test-latex
################################################################################
# Developer targets #
################################################################################
.PHONY: lint
lint:
shellcheck $(shell find . -name "*.sh")
.PHONY: clean
clean:
IMAGE=none make -C test clean