refac: use embed instead of go-bindata, secure closing of transactions

This commit is contained in:
2021-03-21 18:47:14 +01:00
parent 59db7cfc85
commit 7a88aaac0c
98 changed files with 3147 additions and 2525 deletions

View File

@ -30,7 +30,7 @@ EXECUTABLE_TARGETS:= \
${EXECUTABLE}: bin/tmp/${EXECUTABLE}
bin/linux/amd64/${EXECUTABLE}: bindata
bin/linux/amd64/${EXECUTABLE}:
CGO_ENABLED=1 \
GOOS=linux \
GOARCH=amd64 \
@ -38,7 +38,7 @@ bin/linux/amd64/${EXECUTABLE}: bindata
GOPRIVATE=${GOPRIVATE} \
go build -ldflags "-X main.version=${VERSION:v%=%}" -o ${@}
bin/linux/arm/5/${EXECUTABLE}: bindata
bin/linux/arm/5/${EXECUTABLE}:
CGO_ENABLED=1 \
GOOS=linux \
GOARCH=arm \
@ -47,7 +47,7 @@ bin/linux/arm/5/${EXECUTABLE}: bindata
GOPRIVATE=${GOPRIVATE} \
go build -ldflags "-X main.version=${VERSION:v%=%}" -o ${@}
bin/linux/arm/7/${EXECUTABLE}: bindata
bin/linux/arm/7/${EXECUTABLE}:
CC=arm-linux-gnueabihf-gcc \
CGO_ENABLED=1 \
GOOS=linux \
@ -57,46 +57,22 @@ bin/linux/arm/7/${EXECUTABLE}: bindata
GOPRIVATE=${GOPRIVATE} \
go build -ldflags "-X main.version=${VERSION:v%=%}" -o ${@}
bin/tmp/${EXECUTABLE}: bindata
bin/tmp/${EXECUTABLE}:
CGO_ENABLED=1 \
GOPROXY=${GOPROXY} \
GOPRIVATE=${GOPRIVATE} \
go build -ldflags "-X main.version=${VERSION:v%=%}" -o ${@}
# GO-BINDATA
# ==============================================================================
BINDATA_TARGETS := \
pkg/repository/db/postgres/ddl/bindata.go \
pkg/repository/db/postgres/dml/bindata.go \
pkg/repository/db/sqlite3/ddl/bindata.go \
pkg/repository/db/sqlite3/dml/bindata.go
PHONY+=bindata
bindata: clean ${BINDATA_TARGETS}
pkg/repository/db/postgres/ddl/bindata.go:
go-bindata -pkg postgresddl -prefix ${@:%/bindata.go=%} -o ${@} ${@:%/bindata.go=%}/*
pkg/repository/db/postgres/dml/bindata.go:
go-bindata -pkg postgresdml -prefix ${@:%/bindata.go=%} -o ${@} ${@:%/bindata.go=%}/*
pkg/repository/db/sqlite3/ddl/bindata.go:
go-bindata -pkg sqlite3ddl -prefix ${@:%/bindata.go=%} -o ${@} ${@:%/bindata.go=%}/*
pkg/repository/db/sqlite3/dml/bindata.go:
go-bindata -pkg sqlite3dml -prefix ${@:%/bindata.go=%} -o ${@} ${@:%/bindata.go=%}/*
# CLEAN
# ==============================================================================
PHONY+=clean
clean:
rm --force ${BINDATA_TARGETS} || true
rm --force --recursive bin/ || true
# TEST
# ==============================================================================
PHONY+=test/unit
test/unit: bindata
test/unit:
go test -v -race -coverprofile=coverage.txt -covermode=atomic -timeout 600s -count=1 ./pkg/...
PHONY+=test/integration
@ -147,12 +123,6 @@ PHONY+=${EXECUTABLE_TARGETS:%=container-run/%}
${EXECUTABLE_TARGETS:%=container-run/%}:
$(MAKE) container-run COMMAND=${@:container-run/%=%}
# CONTAINER STEPS - GO-BINDATA
# ==============================================================================
PHONY+=container-run/bindata
container-run/bindata:
$(MAKE) container-run COMMAND=${@:container-run/%=%}
# CONTAINER STEPS - CLEAN
# ==============================================================================
PHONY+=container-run/clean