-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
29 lines (22 loc) · 710 Bytes
/
Makefile
File metadata and controls
29 lines (22 loc) · 710 Bytes
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
VPS_HOST ?= $(error Set VPS_HOST, e.g. make deploy VPS_HOST=root@your-server)
VPS_SSH := ssh -p 2200 $(VPS_HOST)
.PHONY: build tui run dev deploy clean
build:
go build -o hub ./cmd/hub
tui:
go build -o sshmail ./cmd/tui
run: build
./hub
dev:
go run ./cmd/hub
deploy:
GOOS=linux GOARCH=amd64 go build -o hub-linux ./cmd/hub
scp -P 2200 hub-linux $(VPS_HOST):/tmp/sshmail-hub-new
$(VPS_SSH) 'systemctl stop sshmail && cp /tmp/sshmail-hub-new /usr/local/bin/sshmail && chmod +x /usr/local/bin/sshmail && systemctl start sshmail'
@echo "Deployed. Verifying..."
@sleep 2
$(VPS_SSH) 'systemctl status sshmail --no-pager | head -5'
rm -f hub-linux
clean:
rm -f hub hub-linux sshmail
rm -rf data/