-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
makefile
109 lines (80 loc) · 2.35 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
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
.PHONY: help
help: makefile
@tail -n +4 makefile | grep ".PHONY"
.PHONY: start-app
start-app:
cd tasklite-webapp \
&& NODE_OPTIONS=--openssl-legacy-provider \
npx elm-app start
# Explicitly run tests for each package for better console output
.PHONY: test
test:
stack test --fast tasklite-core
stack test --fast tasklite
.PHONY: install
install:
stack build --fast --copy-bins tasklite
# Build the documentation
docs: book.toml docs-source
mdbook build
# Build the documentation with Docker
.PHONY: docker-docs
docker-docs: book.toml docs-source
docker run \
--rm \
--volume "$$PWD":/data \
hrektts/mdbook \
mdbook build
# Continuously rebuild and serve at localhost:3000
.PHONY: serve-docs
serve-docs:
mdbook serve
# Continuously rebuild and serve at localhost:3000 with Docker
.PHONY: docker-serve
docker-serve: book.toml docs-source
docker run \
--rm \
--volume "$$PWD":/data \
--publish 3000:3000 \
--publish 3001:3001 \
hrektts/mdbook \
mdbook serve --hostname 0.0.0.0
.PHONY: deploy
deploy: fly.toml
fly deploy
.PHONY: docker-build
docker-build:
# Make sure to have at least 8 GB RAM allocated for the Docker Engine
# as the compilation is quite resource intensive.
# Otherwise you'll get an 137 or -9 error.
docker build \
--tag adius/tasklite:$$(git describe --tags --dirty) \
--tag adius/tasklite:latest \
.
# Possible alternative: https://github.com/MrMarble/termsvg
tasklite/screenshots/help.svg:
term-transcript exec 'tasklite help' > $@ \
|| echo 'ℹ️ Run `cargo install term-transcript-cli`'
cp $@ docs-source/images/help.svg
tasklite/screenshots/help-short.svg:
term-transcript exec 'tasklite help | head -n 30' > $@ \
|| @echo 'ℹ️ Run `cargo install term-transcript-cli`'
# # TODO: Use an extra demo database to not mess up the local one
# # ATTENTION: Set correct commands before executing
# docs-source/images/usage.svg:
# term-transcript exec --io-timeout 1sec \
# 'tl add Buy milk +groceries +demo' \
# 'tl add Go running +demo' \
# 'tl withtag demo' \
# 'tl do TODO' \
# > $@ \
# || @echo 'ℹ️ Run `cargo install term-transcript-cli`'
.PHONY: screenshots
screenshots: tasklite/screenshots/help.svg tasklite/screenshots/help-short.svg
.PHONY: clean
clean:
rm -rf .stack-work
rm -rf docs
rm -rf tasklite-app/.stack-work
rm -rf tasklite-core/.stack-work
rm -rf tasklite/.stack-work