-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
29 lines (22 loc) · 925 Bytes
/
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
PACKAGE=github.com/NexClipper/sudory/pkg
VERSION=$(shell sed -n 's/VERSION=//p' properties.${target})
COMMIT=$(shell git rev-parse HEAD)
BUILD_DATE=$(shell date '+%Y-%m-%dT%H:%M:%S')
LDFLAGS=-X $(PACKAGE)/version.Version=$(VERSION) -X $(PACKAGE)/version.Commit=$(COMMIT) -X $(PACKAGE)/version.BuildDate=$(BUILD_DATE)
prep:
go install github.com/swaggo/swag/cmd/[email protected]
swagger:
cd pkg/server/route;go generate
docker-login:
docker login ${register} -u ${user}
go-build:
env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="$(LDFLAGS)" -o ./bin/${target}/sudory-${target} ./cmd/${target}
docker-build:
docker build -t ${image}-${target}:latest -f Dockerfile.${target} .
docker tag ${image}-${target}:latest ${image}-${target}:$(VERSION)
docker-push:
docker push ${image}-${target}:$(VERSION)
docker push ${image}-${target}:latest
clean:
rm ./bin/server/sudory-server
rm ./bin/client/sudory-client