Skip to content

Commit

Permalink
chore: add version on startup (#240)
Browse files Browse the repository at this point in the history
  • Loading branch information
mpetrun5 authored Nov 30, 2023
1 parent a6be32a commit e86c9d9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ADD . /src
WORKDIR /src
RUN cd /src && echo $(ls -1 /src)
RUN go mod download
RUN go build -ldflags "-X google.golang.org/protobuf/reflect/protoregistry.conflictPolicy=ignore" -o /bridge .
RUN go build -ldflags "-X google.golang.org/protobuf/reflect/protoregistry.conflictPolicy=ignore -X github.com/ChainSafe/sygma-relayer/app.Version=$(sed -n '0,/## \[\([0-9.]*\)\]/s/.*\[\([0-9.]*\)\].*/\1/p' CHANGELOG.md)" -o /bridge .

# final stage
FROM debian:stable-slim
Expand Down
4 changes: 3 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ import (
"github.com/spf13/viper"
)

var Version string

func Run() error {
var err error

Expand Down Expand Up @@ -276,7 +278,7 @@ func Run() error {
syscall.SIGQUIT)

relayerName := viper.GetString("name")
log.Info().Msgf("Started relayer: %s with PID: %s", relayerName, host.ID().Pretty())
log.Info().Msgf("Started relayer: %s with PID: %s. Version: v%s", relayerName, host.ID().Pretty(), Version)

_, err = keyshareStore.GetKeyshare()
if err != nil {
Expand Down

0 comments on commit e86c9d9

Please sign in to comment.