-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
89 lines (71 loc) · 2 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
.oneshell:
WEBAPPS := $(dir $(wildcard **/*/webapp/package.json))
BINARY := doorman
export SMTP_SERVER=localhost:2525
export SMTP_SERVER_USER=
export SMTP_SERVER_PASSWORD=
define compile_and_run_target
rm -rf $(HOME)/tmp/modd-$(1).conf
mkdir -p $(HOME)/tmp
echo -e 'test/caddy.json *.go {\n prep +onchange: $(MAKE) $(1)\n daemon +sigterm: $(MAKE) localrun-$(1) \n}' >> $(HOME)/tmp/modd-$(1).conf
modd -f $(HOME)/tmp/modd-$(1).conf
endef
.PHONY:
dev: ;
# this tasks spawns nsqd, a postgres instance a dummy webserver as backend and all the
# daemons of this repository with wathing for file changes
tmuxp load devsession.yml
.PHONY:
testrunner:
goconvey -port 6081 -excludedDirs="webapp,bin,test"
.PHONY:
all: $(BINARY);
# next target is used by tmux-session specified in devsession.yml
.PHONY:
dev-%: %
+$(call compile_and_run_target,$<)
.PHONY:
dev-frontend:
cd webapp && npm i && npm run dev
.PHONY:
build-frontend:
cd webapp && npm i && npm run build
.PHONY:
dev-%: %
+$(call compile_and_run_target,$<)
.PHONY:
$(BINARY):
mkdir -p bin
CGO_ENABLED=0 go build -o bin/$@ ./cmd
.PHONY:
localrun-%: %
bin/$< run --config test/caddy.json
.PHONY:
docker-image:
docker build -t quay.io/ulrichschreiner/doorman .
.PHONY:
second-instance:
sed 's/:2015/:22015/g' test/caddy.json >/tmp/caddy.json
bin/$(BINARY) run --config /tmp/caddy.json
.PHONY:
testldap:
@docker build -t doorman-testldap -f test/Dockerfile.ldap test/
@docker run -it --rm -p 6389:389 -p 6636:636 --name doorman-testldap doorman-testldap
.PHONY:
keydb-ephemeral:
docker run -it --rm -p 16379:6379 --name doorman-keydb eqalpha/keydb
.PHONY:
redis-cli:
docker exec -it doorman-keydb redis-cli
.PHONY:
smtp4dev:
docker run --rm -it -p 3000:80 -p 2525:25 rnwood/smtp4dev
.PHONY:
install-devtools-arch:
# install https://github.com/cortesi/modd
# install https://github.com/tmux-python/tmuxp
#
# this is more or less for documentation purposes ... both tools
# are used for local development
sudo pacman -S community/tmuxp
yay -S aur/modd