From c9f1cf3cb60e80be31a02e2e561af7248dbdfb3e Mon Sep 17 00:00:00 2001 From: Denis Kirillov Date: Mon, 6 Dec 2021 09:58:15 +0300 Subject: [PATCH] [#287] Add version Signed-off-by: Denis Kirillov --- Makefile | 2 +- VERSION | 1 + cmd/s3-gw/app.go | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 VERSION diff --git a/Makefile b/Makefile index ed43e588..6f58f82e 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ # Common variables REPO ?= $(shell go list -m) -VERSION ?= "$(shell git describe --tags 2>/dev/null || git rev-parse --short HEAD | sed 's/^v//')" +VERSION ?= $(shell git describe --tags 2>/dev/null || cat VERSION 2>/dev/null || echo "develop") BINDIR = bin # Binaries to build diff --git a/VERSION b/VERSION new file mode 100644 index 00000000..6b60281a --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +v0.17.0 diff --git a/cmd/s3-gw/app.go b/cmd/s3-gw/app.go index 3e6ff669..bea58987 100644 --- a/cmd/s3-gw/app.go +++ b/cmd/s3-gw/app.go @@ -15,6 +15,7 @@ import ( "github.com/nspcc-dev/neofs-s3-gw/api/cache" "github.com/nspcc-dev/neofs-s3-gw/api/handler" "github.com/nspcc-dev/neofs-s3-gw/api/layer" + "github.com/nspcc-dev/neofs-s3-gw/internal/version" "github.com/nspcc-dev/neofs-s3-gw/internal/wallet" "github.com/nspcc-dev/neofs-sdk-go/policy" "github.com/nspcc-dev/neofs-sdk-go/pool" @@ -155,7 +156,7 @@ func newApp(ctx context.Context, l *zap.Logger, v *viper.Viper) *App { // Wait waits for application to finish. func (a *App) Wait() { - a.log.Info("application started") + a.log.Info("application started", zap.String("version", version.Version)) <-a.webDone // wait for web-server to be stopped