forked from staticbackendhq/core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
57 lines (43 loc) · 1.55 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
include .env
export $(shell sed 's/=.*//' .env)
build:
@cd cmd && rm -rf staticbackend && go build -o staticbackend
start: build
@./cmd/staticbackend
deploy: build
scp cmd/staticbackend sb-poc:/home/dstpierre/sb
scp -qr ./templates/* sb-poc:/home/dstpierre/templates/
scp -qr ./sql/* sb-poc:/home/dstpierre/sql/
alltest:
@go test --race --cover ./...
thistest:
@JWT_SECRET=okdevmode go test -run "$2" --race --cover
test-core:
@go test --race --cover
test-pg:
@cd database/postgresql && go test --race --cover
test-mdb:
@cd database/mongo && go test --race --cover
test-mem:
@rm -rf database/memory/mem.db
@go test --race --cover ./database/memory
test-intl:
@JWT_SECRET=okdevmode go test --race --cover ./internal
test-extra:
@JWT_SECRET=okdevmode go test --race --cover ./extra
stripe-dev:
stripe listen -p sb --forward-to http://localhost:8099/stripe
docker: build
docker build . -t staticbackend:latest
pkg: build
@rm -rf dist/*
@echo "building linux binaries"
@cd cmd && CGO_ENABLED=0 GOARCH=amd64 GOOS=linux go build -o ../dist/binary-for-linux-64-bit
@cd cmd && CGO_ENABLED=0 GOARCH=386 GOOS=linux go build -o ../dist/binary-for-linux-32-bit
@echo "building mac binaries"
@cd cmd && CGO_ENABLED=0 GOARCH=amd64 GOOS=darwin go build -o ../dist/binary-for-mac-64-bit
@echo "building windows binaries"
@cd cmd && CGO_ENABLED=0 GOARCH=amd64 GOOS=windows go build -o ../dist/binary-for-windows-64-bit.exe
@cd cmd && CGO_ENABLED=0 GOARCH=386 GOOS=windows go build -o ../dist/binary-for-windows-32-bit.exe
@echo "compressing binaries"
@gzip dist/*