feat(pkg/db): postgres database
This commit is contained in:
19
Makefile
19
Makefile
@ -8,7 +8,7 @@ GID?=$(shell id --group)
|
||||
# VERSION
|
||||
# If no version is specified as a parameter of make, the last git hash
|
||||
# value is taken.
|
||||
VERSION:=$(or ${TRAVIS_TAG}, ${TRAVIS_TAG}, $(shell git rev-parse --short HEAD)-git)
|
||||
VERSION:=$(or ${TRAVIS_TAG}, $(shell git rev-parse --short HEAD)-git)
|
||||
|
||||
CONTAINER_RUNTIME?=$(shell which docker)
|
||||
|
||||
@ -16,23 +16,24 @@ GOARCH?=amd64
|
||||
GOOS?=linux
|
||||
|
||||
# default build
|
||||
build:
|
||||
go-build: bindata
|
||||
GOOS=${GOOS} \
|
||||
GOARCH=${GOARCH} \
|
||||
go build -ldflags "-X main.version=${VERSION}"
|
||||
chown -R ${UID}:${GID} *
|
||||
|
||||
test: bindata
|
||||
go-test: go-build
|
||||
go test -v ./pkg/...
|
||||
|
||||
bindata:
|
||||
go-bindata -pkg logfile_test -o ./pkg/logfile/bindata_test.go ./pkg/logfile/test/***
|
||||
go-bindata -pkg db -o ./pkg/db/bindataSQL.go ./pkg/db/sql/***
|
||||
go-bindata -pkg goldenfiles -o ./test/goldenfiles/bindata.go ./test/goldenfiles/json/***
|
||||
|
||||
container-build:
|
||||
$(MAKE) container-run COMMAND=build
|
||||
container-go-build:
|
||||
$(MAKE) container-run COMMAND=go-build
|
||||
|
||||
container-test:
|
||||
$(MAKE) container-run COMMAND=test
|
||||
container-go-test:
|
||||
$(MAKE) container-run COMMAND=go-test
|
||||
|
||||
container-run:
|
||||
${CONTAINER_RUNTIME} run \
|
||||
@ -42,6 +43,6 @@ container-run:
|
||||
make ${COMMAND} UID=${UID} GID=${GID} VERSION=${VERSION} GOOS=${GOOS} GOARCH=${GOARCH}
|
||||
|
||||
remote:
|
||||
$(MAKE) build GOARCH=arm
|
||||
$(MAKE) go-build GOARCH=arm
|
||||
scp flucky ${FLUCKY_REMOTE}:/usr/local/bin
|
||||
ssh ${FLUCKY_REMOTE} "chmod +x /usr/local/bin/flucky"
|
||||
|
Reference in New Issue
Block a user