-
Notifications
You must be signed in to change notification settings - Fork 61
/
Makefile
82 lines (63 loc) · 1.8 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
-include .env.example
-include .env
export $(shell bash -c "sed 's/=.*//' .env.example || true" )
export $(shell bash -c "sed 's/=.*//' .env || true" )
export UID=$(shell id -u)
export GID=$(shell id -g)
SHELL:=bash
.ONESHELL:
.PHONY: docs docs-clean docker-docs docker-paper paper-preprint docker-paper-preprint
######################## Docs #################################################
docs:
@$(MAKE) --no-print-directory -C docs/ html
docs-clean:
rm -rf docs/build
.ONESHELL:
docker-docs:
@set -euox
@docker build -t nextclade-docs-builder \
--network=host \
--build-arg UID=$(shell id -u) \
--build-arg GID=$(shell id -g) \
docs/
@docker run -it --rm \
--name=nextclade-docs-builder-$(shell date +%s) \
--init \
--user=$(shell id -u):$(shell id -g) \
--volume=$(shell pwd):/workdir \
--publish=8000:8000 \
nextclade-docs-builder
######################## Paper ################################################
.ONESHELL:
docker-paper:
@set -euox
@docker run -it --rm \
--name=nextclade-paper-builder-$(shell date +%s) \
--init \
--user=$(shell id -u):$(shell id -g) \
--volume=$(shell pwd)/paper:/data \
--publish=8000:8000 \
--workdir=/data \
--env 'TERM=xterm-256colors' \
--env 'JOURNAL=joss' \
openjournals/paperdraft
paper-preprint:
@set -euxo pipefail
@cd paper/
@./scripts/build_preprint.sh
docker-paper-preprint:
@set -euxo pipefail
@export CONTAINER_IMAGE_NAME=nextclade-preprint-builder
@docker build -t "$${CONTAINER_IMAGE_NAME}" \
--network=host \
paper/
@docker run -it --rm \
--init \
--name="$${CONTAINER_IMAGE_NAME}-$(shell date +%s)" \
--user="$(shell id -u):$(shell id -g)" \
--volume="$(shell pwd):/home/user/src" \
--workdir="/home/user/src" \
--env "TERM=xterm-256colors" \
--ulimit core=0 \
"$${CONTAINER_IMAGE_NAME}" \
bash -c "make paper-preprint"