Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
114 lines (88 loc) · 3.04 KB
/
Copy pathMakefile
File metadata and controls
114 lines (88 loc) · 3.04 KB
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
-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 clean distclean data
######################## Docs #################################################
docs:
@$(MAKE) --no-print-directory -C docs/ html
docs-clean:
rm -rf $(CURDIR)/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"
######################## Data #################################################
data:
@./scripts/get-data
######################## Clean ################################################
clean:
rm -rf $(CURDIR)/docs/build
rm -rf $(CURDIR)/.cache
rm -rf $(CURDIR)/.build
rm -rf $(CURDIR)/.out $(CURDIR)/.temp $(CURDIR)/.tmp
rm -rf $(CURDIR)/packages/nextclade-web/.cache
rm -rf $(CURDIR)/packages/nextclade-web/.build
rm -rf $(CURDIR)/packages/nextclade-web/.next
rm -rf $(CURDIR)/packages/nextclade-web/.eslintcache
rm -rf $(CURDIR)/packages/nextclade-web/src/gen
rm -rf $(CURDIR)/packages/nextclade-web/test-results
rm -rf $(CURDIR)/packages/nextclade-web/playwright-report
find $(CURDIR) -name '*.log' -not -path '$(CURDIR)/target/*' -not -path '*/node_modules/*' -delete
find $(CURDIR) -name '*.tsbuildinfo' -not -path '$(CURDIR)/target/*' -not -path '*/node_modules/*' -delete
find $(CURDIR) -name '.DS_Store' -delete
find $(CURDIR) -name '__pycache__' -type d -exec rm -rf {} + 2>/dev/null || true
find $(CURDIR) -name '.pytest_cache' -type d -exec rm -rf {} + 2>/dev/null || true
distclean: clean
rm -rf $(CURDIR)/target
rm -rf $(CURDIR)/packages/*/target
rm -rf $(CURDIR)/packages/nextclade-web/node_modules