Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .dlv-init
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
config prompt-color "\033[32m"
config disassemble-flavor "intel"
config substitute-path "github.com/ozontech/seq-db" ""
27 changes: 18 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,6 @@ VERSION ?= $(shell git describe --abbrev=4 --dirty --always --tags)
TIME := $(shell date '+%Y-%m-%d_%H:%M:%S')

LOCAL_BIN:=$(CURDIR)/bin
.PHONY: build-binaries
build-binaries:
CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH} go build \
-trimpath \
-ldflags "-X github.com/ozontech/seq-db/buildinfo.Version=${VERSION} \
-X github.com/ozontech/seq-db/buildinfo.BuildTime=${TIME}" \
-o ./bin/${OS}-${ARCH}/ \
./cmd/...

.PHONY: build-image
build-image:
Expand All @@ -30,13 +22,30 @@ build-image:
-t ${IMAGE}:${VERSION} \
.

.PHONY: build-debug
build-debug:
CGO_ENABLED=0 \
go build -gcflags="all=-N -l" \
-o ${LOCAL_BIN}/${OS}-${ARCH}/ \
./cmd/...

.PHONY: run
run: build-binaries
run: build-debug
SEQDB_STORAGE_DATA_DIR=$(shell mktemp -d) \
${LOCAL_BIN}/${OS}-${ARCH}/seq-db \
--mode=single \
--config=config.example.yaml

.PHONY: debug
debug: build-debug
SEQDB_STORAGE_DATA_DIR=$(shell mktemp -d) \
${LOCAL_BIN}/${OS}-${ARCH}/seq-db \
--mode=single \
--config=config.example.yaml & \
DLV_PID=$$!; \
sleep 1; \
dlv attach $$DLV_PID --init=.dlv-init

.PHONY: push-image
push-image: build-image
docker push ${IMAGE}:${VERSION}
Expand Down
Loading