-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
45 lines (33 loc) · 1.3 KB
/
Makefile
File metadata and controls
45 lines (33 loc) · 1.3 KB
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
#!make
.PHONY: *
include .env.development
include .env
export $(shell sed 's/=.*//' .env.development)
export $(shell sed 's/=.*//' .env)
build_server:
go run main.go
test:
go test ./internal/...
staticcheck:
staticcheck ./...
web:
cd web && bun run dev
deploy:
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -a -installsuffix cgo -ldflags="-s -w" -o gempbot main.go
ssh -o StrictHostKeyChecking=no -p 32022 -i ansible/.ssh_key ubuntu@o1.gempir.com "sudo systemctl stop gempbot"
rsync -avz -e "ssh -o StrictHostKeyChecking=no -p 32022 -i ansible/.ssh_key" gempbot ubuntu@o1.gempir.com:/home/gempbot/
ssh -o StrictHostKeyChecking=no -p 32022 -i ansible/.ssh_key ubuntu@o1.gempir.com "sudo chown gempbot:gempbot /home/gempbot/gempbot"
ssh -o StrictHostKeyChecking=no -p 32022 -i ansible/.ssh_key ubuntu@o1.gempir.com "sudo systemctl restart gempbot-migrate && sudo systemctl start gempbot"
ansible:
cd ansible && ansible-vault decrypt ssh_key.vault --output=.ssh_key
chmod 600 ansible/.ssh_key
provision:
cd ansible && OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES ansible-playbook -i hosts playbook.yml --private-key=.ssh_key
migrate:
go run main.go migrate
docker:
docker build . -t gempbot
run_docker:
docker run --env-file=.env -p 3010:3010 gempbot
tunnel:
npx localtunnel --port 3010 --subdomain gempbot