2021-10-01 14:40:07 +00:00
|
|
|
TMUX_SESSION=knowyt
|
2022-11-06 08:47:43 +00:00
|
|
|
VERSION=$(shell grep version client/package.json | cut -d\" -f4)
|
2021-07-29 16:39:27 +00:00
|
|
|
|
2022-09-25 15:27:34 +00:00
|
|
|
.PHONY: info run-all run-server run-client run-tmux build podman clean
|
2022-03-09 08:09:13 +00:00
|
|
|
|
2021-07-29 16:39:27 +00:00
|
|
|
info:
|
|
|
|
@echo available targets:
|
|
|
|
@perl -ne 'm/^([\w\-]+):/ && print(" $$1\n");' Makefile
|
|
|
|
|
2022-11-06 08:47:43 +00:00
|
|
|
setup:
|
2022-07-13 08:05:07 +00:00
|
|
|
@echo "I checking for tools"
|
|
|
|
@for binary in go tmux node yarn npx podman; do \
|
|
|
|
echo -n " $$binary: " ; \
|
|
|
|
if ! which "$$binary"; then \
|
|
|
|
echo "not found" ;\
|
|
|
|
exit 1 ;\
|
|
|
|
fi ;\
|
|
|
|
done
|
|
|
|
@echo "I installing client dependencies"
|
|
|
|
( cd client && yarn install )
|
|
|
|
@echo "I installing server dependencies"
|
2022-11-04 20:51:14 +00:00
|
|
|
$(MAKE) -C server setup
|
2022-09-01 17:18:13 +00:00
|
|
|
@echo "I create client output directory"
|
|
|
|
mkdir -p client/.output/public/
|
2022-07-13 08:05:07 +00:00
|
|
|
|
2021-07-29 16:39:27 +00:00
|
|
|
run-all:
|
|
|
|
pexec -R -c -e TARGET \
|
|
|
|
-r run-client \
|
|
|
|
-r run-server \
|
|
|
|
-- $(MAKE) '$$TARGET'
|
|
|
|
|
|
|
|
run-tmux:
|
|
|
|
tmux start-server
|
|
|
|
-tmux kill-session -t "$(TMUX_SESSION)"
|
|
|
|
tmux new-session -d -s "$(TMUX_SESSION)"
|
|
|
|
tmux send-keys "make run-client" C-m
|
|
|
|
tmux splitw -v -l 5
|
|
|
|
tmux send-keys "make run-server" C-m
|
|
|
|
tmux attach-session -t "$(TMUX_SESSION)"
|
|
|
|
|
|
|
|
run-client:
|
|
|
|
(cd client/ && yarn dev)
|
|
|
|
|
|
|
|
run-server:
|
|
|
|
$(MAKE) -C server run-loop
|
|
|
|
|
|
|
|
build:
|
2022-04-24 21:51:00 +00:00
|
|
|
echo $(VERSION)
|
2021-07-29 16:39:27 +00:00
|
|
|
(cd client/ && yarn generate)
|
|
|
|
$(MAKE) -C server build
|
2022-11-06 08:47:43 +00:00
|
|
|
$(MAKE) podman-build
|
|
|
|
$(MAKE) podman-save
|
|
|
|
|
|
|
|
podman-build:
|
2022-11-06 08:50:13 +00:00
|
|
|
cp ./knowyt ../build/files/
|
2022-11-06 08:47:43 +00:00
|
|
|
podman build --tag knowyt:$(VERSION) .
|
|
|
|
|
|
|
|
podman-save:
|
|
|
|
rm -f build/knowyt-$(VERSION).tar
|
|
|
|
podman save knowyt:$(VERSION) -o build/knowyt-$(VERSION).tar
|
|
|
|
ls -lh build/knowyt-$(VERSION).tar
|
2021-07-29 16:39:27 +00:00
|
|
|
|
2022-09-25 15:27:34 +00:00
|
|
|
podman-run:
|
2022-11-06 08:47:43 +00:00
|
|
|
podman run --rm -it -p 32039:32039 -v $$(PWD)/server/data/:/data --name knowyt knowyt:$(VERSION)
|
2022-03-03 09:29:01 +00:00
|
|
|
|
2022-11-06 08:47:43 +00:00
|
|
|
podman-stop:
|
|
|
|
podman stop knowyt
|
2021-08-04 23:45:31 +00:00
|
|
|
|
|
|
|
clean:
|
2022-09-01 17:18:13 +00:00
|
|
|
rm -rf client/.output/
|
2021-08-05 00:22:28 +00:00
|
|
|
rm -rf client/.nuxt/
|
2022-03-03 07:40:14 +00:00
|
|
|
$(MAKE) -C server clean
|
2022-11-06 08:47:43 +00:00
|
|
|
rm -f build/files/knowyt build/knowyt-*.tar
|
2022-10-05 07:40:18 +00:00
|
|
|
|
|
|
|
reset-data:
|
|
|
|
rm -rf server/data/
|
2022-11-06 08:15:37 +00:00
|
|
|
git checkout server/data/
|
|
|
|
|