-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
75 lines (53 loc) · 2.01 KB
/
Makefile
File metadata and controls
75 lines (53 loc) · 2.01 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
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
APP=backend-api
LDFLAGS+="-s -w"
init:
export GOPRIVATE=gitlab.com/*
export GO111MODULE=on
export GIT_TERMINAL_PROMPT=1
export GOPROXY=direct
export GOSUMDB=off
proto:
protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative utils/proto/*.proto
test:
go test -v -cover -covermode=atomic ./app_test/...
build:
go build -v -ldflags $(LDFLAGS) -o $(APP)
swagger:
swag init -g main.go
api:
go run main.go
unittest:
go test -short ./internal/app_test
clean:
if [ -f ${BINARY} ] ; then rm ${BINARY} ; fi
build-docker:
docker build -t ${APP} .
run:
docker-compose up --build -d
stop:
docker-compose down
lint-prepare:
@echo "Installing golangci-lint"
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s latest
lint:
./bin/golangci-lint run ./...
.PHONY: clean install unittest build docker run stop vendor lint-prepare lint
build-gpu-develop:
git pull origin develop && git checkout gpu-develop && git merge develop && git push origin gpu-develop && git checkout develop
build-staging:
git pull origin develop
git checkout staging && git pull origin staging && git merge develop && git push origin staging
git checkout gpu-staging && git pull origin gpu-staging && git merge staging && git push origin gpu-staging
git checkout develop
start-docker:
docker-compose stop api_service && docker-compose up -d api_service && docker logs -f api_service
reload-docker:
docker-compose stop api_service && docker-compose build api_service && docker-compose up -d api_service && docker logs -f api_service
exec-docker:
docker exec -it api_service bash
start-xserver:
docker-compose stop api_xserver && docker-compose build api_xserver && docker-compose up -d api_xserver
connect-xserver-staging:
k port-forward service/generative-moderator-gpu -n staging 6080:6080
connect-xserver-develop:
k port-forward service/generative-moderator-gpu -n develop 6080:6080