-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
74 lines (61 loc) · 1.73 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
CLI_NAME:='dama'
SERVER_NAME:='dama-proxy'
VERSION:=$(shell date "+%Y%m%d")
PACKAGES:=$(shell go list ./... | grep -v /vendor/)
LDFLAGS:='-s -w -X "main.version=$(VERSION)"'
define config
images: ["perlogix/minimal:latest"]
expire: "1300"
deployexpire: "86400"
uploadsize: 2000000000
envsize: 20
https:
listen: "0.0.0.0"
port: "8443"
pem: "./dama.pem"
key: "./dama.key"
debug: false
verifytls: false
db:
network: "unix"
address: "./tmp/redis.sock"
db: 0
maxretries: 20
docker:
endpoint: "unix:///var/run/docker.sock"
cpushares: 512
memory: 1073741824
gotty:
tls: false
endef
export config
default: build
run:
sudo -E ./dama-proxy
cli:
go build -ldflags $(LDFLAGS) -o $(CLI_NAME) ./cmd/cli
server:
CGO_ENABLED=0 GOOS=linux go build -ldflags $(LDFLAGS) -a -installsuffix cgo -tags=jsoniter -o $(SERVER_NAME) .
build:
CGO_ENABLED=0 GOOS=linux go build -ldflags $(LDFLAGS) -a -installsuffix cgo -tags=jsoniter -o $(SERVER_NAME) .
go build -ldflags $(LDFLAGS) -o $(CLI_NAME) ./cmd/cli
buildall:
CGO_ENABLED=0 GOOS=linux go build -ldflags $(LDFLAGS) -a -installsuffix cgo -tags=jsoniter -o $(SERVER_NAME) .
GOOS=linux go build -ldflags $(LDFLAGS) -o $(CLI_NAME) ./cmd/cli
GOOS=darwin go build -ldflags $(LDFLAGS) -o $(CLI_NAME)-darwin ./cmd/cli
GOOS=windows go build -ldflags $(LDFLAGS) -o $(CLI_NAME)-windows ./cmd/cli
gofmt:
go fmt ./...
lint: gofmt
$(GOPATH)/bin/golint $(PACKAGES)
$(GOPATH)/bin/golangci-lint run
$(GOPATH)/bin/gosec -quiet -no-fail ./...
update-deps:
go get -u ./...
go mod tidy
certs:
openssl req -subj '/CN=dama/O=dama/C=US' -new -newkey rsa:2048 -sha256 -days 365 -nodes -x509 -keyout dama.key -out dama.pem
config:
@echo "$$config" > config.yml
docker:
docker build -t perlogix/dama:latest .