https://nossa.ee · This website! ·
elixir git
r/o

nossa / Makefile

1
DEFAULT = nix/node2nix-default.nix
2
NODE_ENV = nix/node2nix-node-env.nix
3
NODE_PACKAGES = nix/node2nix-node-packages.nix
4
5
PACKAGE_JSON = assets/package.json
6
PACKAGE_LOCK_JSON = assets/package-lock.json
7
8
9
all: $(DEFAULT)
10
11
server:
12
iex -S mix phx.server
13
14
testwatch:
15
fd -eex -eexs -eheex -ers . . | entr -c env MIX_ENV=test mix test ${ARGS}
16
17
coverwatch:
18
fd -eex -eexs -eheex -ers . . | entr -c env MIX_ENV=test mix test --cover ${ARGS}
19
20
pg:
21
pg_ctl -D $(shell pwd)/db -l logfile start
22
23
pgstop:
24
pg_ctl -D $(shell pwd)/db stop
25
26
deploy-container:
27
nix build .#nossa-docker && ./result | doas ctr -n k8s.io image import -
28
29
.PHONY: nossa.tar
30
31
nossa.tar:
32
nix build .#packages.aarch64-linux.nossa-docker && \
33
sudo ssh rosetta-builder $$(readlink result) > nossa.tar
34
35
deploy-container-kind: nossa.tar
36
docker load < nossa.tar
37
38
39
$(DEFAULT): $(PACKAGE_JSON) $(PACKAGE_LOCK_JSON)
40
node2nix -18 \
41
--input $(PACKAGE_JSON) \
42
--lock $(PACKAGE_LOCK_JSON) \
43
--output $(NODE_PACKAGES) \
44
--node-env $(NODE_ENV) \
45
--composition $(DEFAULT)
46
treefmt \
47
$(NODE_PACKAGES) \
48
$(NODE_ENV) \
49
$(DEFAULT)
50