diff --git a/Dockerfile b/Dockerfile index 5bb6a77..89a896e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,8 +14,9 @@ COPY queue queue COPY webhook webhook COPY metrics metrics RUN apt-get update && apt-get install -y libsecp256k1-0 libsodium23 -RUN go build -o /tmp/processor github.com/gobicycle/bicycle/cmd/processor -RUN go build -o /tmp/testutil github.com/gobicycle/bicycle/cmd/testutil +ARG GIT_TAG +RUN go build -ldflags "-X main.Version=$GIT_TAG" -o /tmp/processor github.com/gobicycle/bicycle/cmd/processor +RUN go build -ldflags "-X main.Version=$GIT_TAG" -o /tmp/testutil github.com/gobicycle/bicycle/cmd/testutil FROM docker.io/library/ubuntu:20.04 AS payment-processor RUN apt-get update && apt-get install -y openssl ca-certificates libsecp256k1-0 libsodium23 wget && rm -rf /var/lib/apt/lists/* diff --git a/Makefile b/Makefile index 57173ad..679538e 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,7 @@ VERSION := latest +GIT_TAG := $(shell git describe --tags --always) build: - docker build -t payment-processor:$(VERSION) --target payment-processor . - docker build -t payment-test:$(VERSION) --target payment-test . \ No newline at end of file + @echo "Building tag: $(GIT_TAG)" + docker build --build-arg GIT_TAG=$(GIT_TAG) -t payment-processor:$(VERSION) --target payment-processor . + docker build --build-arg GIT_TAG=$(GIT_TAG) -t payment-test:$(VERSION) --target payment-test . \ No newline at end of file diff --git a/cmd/processor/main.go b/cmd/processor/main.go index 265d967..aae738c 100644 --- a/cmd/processor/main.go +++ b/cmd/processor/main.go @@ -19,7 +19,12 @@ import ( "time" ) +var Version = "dev" + func main() { + + log.Infof("App version: %s", Version) + config.GetConfig() sigChannel := make(chan os.Signal, 1) diff --git a/cmd/testutil/main.go b/cmd/testutil/main.go index e33170c..2083e62 100644 --- a/cmd/testutil/main.go +++ b/cmd/testutil/main.go @@ -14,6 +14,7 @@ import ( var ( onlyMonitoring = true + Version = "dev" ) const ( @@ -25,6 +26,8 @@ const ( func main() { + log.Printf("App version: %s", Version) + config.GetConfig() if circulation := os.Getenv("CIRCULATION"); circulation == "true" { onlyMonitoring = false diff --git a/release_notes.md b/release_notes.md index b482737..50de8ce 100644 --- a/release_notes.md +++ b/release_notes.md @@ -15,3 +15,6 @@ 13. Add `last_block_gen_utime` field to `/v1/system/sync` method to get unix time of the last scanned block 14. Add `FORWARD_TON_AMOUNT` env variable to customize `forward_ton_amount` for Jetton withdrawals 15. Binary comment support + +# v0.6.0 release notes +1. Displaying the application version at startup \ No newline at end of file diff --git a/todo_list.md b/todo_list.md index 0ef3484..e8aa208 100644 --- a/todo_list.md +++ b/todo_list.md @@ -68,6 +68,7 @@ - [x] Add last block time to /v1/system/sync method - [x] Forward ton amount customization - [x] Binary comment support for withdrawals +- [x] Show app ver at start - [ ] Get withdrawal by tx hash method - [ ] Add incorrect processing of some TON deposit replenishments for failed transaction to threat model - [ ] Duplicates of external withdrawals for DB backup problem