-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
44 lines (34 loc) · 1.11 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
NAME=marketplace
VERSION?=$$(git rev-parse HEAD)
REGISTRY_SERVER?=registry.videocoin.net
REGISTRY_PROJECT?=cloud
default: build
version:
@echo ${VERSION}
build:
GOOS=${GOOS} GOARCH=${GOARCH} go build \
-mod vendor \
-ldflags="-w -s -X main.Version=${VERSION}" \
-o bin/${NAME} \
./cmd/${NAME}/main.go
.PHONY: vendor
vendor:
go mod vendor
# https://github.com/ethereum/go-ethereum/issues/2738
cp -r $(GOPATH)/src/github.com/ethereum/go-ethereum/crypto/secp256k1/libsecp256k1 \
vendor/github.com/ethereum/go-ethereum/crypto/secp256k1/
cp -r $(GOPATH)/src/github.com/karalabe/usb/hidapi \
vendor/github.com/karalabe/usb/hidapi/
cp -r $(GOPATH)/src/github.com/karalabe/usb/libusb \
vendor/github.com/karalabe/usb/libusb/
db-status:
goose -dir migrations postgres ${DB_URI} status
db-up:
goose -dir migrations postgres ${DB_URI} up
db-down:
goose -dir migrations postgres ${DB_URI} down
docker-build:
docker build -t ${REGISTRY_SERVER}/${REGISTRY_PROJECT}/${NAME}:${VERSION} -f Dockerfile .
docker-push:
docker push ${REGISTRY_SERVER}/${REGISTRY_PROJECT}/${NAME}:${VERSION}
release: docker-build docker-push