Skip to content

Commit

Permalink
Merge pull request #18 from gobicycle/develop
Browse files Browse the repository at this point in the history
setting git tag to var at build
  • Loading branch information
gobicycle authored Jun 19, 2024
2 parents 928fbfb + a124af6 commit 6492b5d
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 4 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/*
Expand Down
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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 .
@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 .
5 changes: 5 additions & 0 deletions cmd/processor/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions cmd/testutil/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (

var (
onlyMonitoring = true
Version = "dev"
)

const (
Expand All @@ -25,6 +26,8 @@ const (

func main() {

log.Printf("App version: %s", Version)

config.GetConfig()
if circulation := os.Getenv("CIRCULATION"); circulation == "true" {
onlyMonitoring = false
Expand Down
3 changes: 3 additions & 0 deletions release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions todo_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6492b5d

Please sign in to comment.