From 68ba24ff73db6b32ab39fa31b5e3c79c443e638b Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Tue, 5 Oct 2021 12:39:31 +0200 Subject: [PATCH] fix extensions versions --- .make/go.mk | 7 ++++--- accounts/pkg/command/root.go | 2 +- accounts/pkg/server/http/server.go | 2 +- changelog/unreleased/fix-builtime-version.md | 6 ++++++ glauth/pkg/command/root.go | 2 +- glauth/pkg/server/debug/server.go | 2 +- glauth/pkg/version/version.go | 19 ------------------- graph-explorer/pkg/command/root.go | 2 +- graph-explorer/pkg/server/debug/server.go | 2 +- graph-explorer/pkg/server/http/server.go | 2 +- graph-explorer/pkg/version/version.go | 19 ------------------- graph/pkg/command/root.go | 2 +- graph/pkg/server/debug/server.go | 2 +- graph/pkg/server/http/server.go | 2 +- graph/pkg/version/version.go | 19 ------------------- idp/pkg/command/root.go | 2 +- idp/pkg/version/version.go | 19 ------------------- {accounts/pkg => ocis-pkg}/version/version.go | 0 ocis/pkg/command/accounts.go | 2 +- ocis/pkg/command/glauth.go | 2 +- ocis/pkg/command/idp.go | 2 +- ocis/pkg/command/ocs.go | 2 +- ocis/pkg/command/proxy.go | 2 +- ocis/pkg/command/root.go | 2 +- ocis/pkg/command/settings.go | 2 +- ocis/pkg/command/store.go | 2 +- ocis/pkg/command/thumbnails.go | 2 +- ocis/pkg/command/webdav.go | 2 +- ocis/pkg/version/version.go | 19 ------------------- ocs/pkg/command/root.go | 2 +- ocs/pkg/version/version.go | 19 ------------------- proxy/pkg/command/root.go | 2 +- proxy/pkg/version/version.go | 19 ------------------- settings/pkg/command/root.go | 2 +- settings/pkg/server/debug/server.go | 2 +- settings/pkg/server/http/server.go | 2 +- settings/pkg/version/version.go | 19 ------------------- storage/pkg/command/gateway.go | 2 ++ storage/pkg/command/root.go | 2 +- storage/pkg/command/storagemetadata.go | 2 ++ storage/pkg/server/debug/server.go | 2 +- storage/pkg/service/external/external.go | 4 ++-- storage/pkg/version/version.go | 19 ------------------- store/pkg/command/root.go | 2 +- store/pkg/version/version.go | 19 ------------------- thumbnails/pkg/command/root.go | 2 +- thumbnails/pkg/server/grpc/server.go | 2 +- thumbnails/pkg/version/version.go | 19 ------------------- web/pkg/command/root.go | 2 +- web/pkg/server/debug/server.go | 2 +- web/pkg/server/http/server.go | 2 +- web/pkg/version/version.go | 19 ------------------- webdav/pkg/command/root.go | 2 +- webdav/pkg/version/version.go | 19 ------------------- 54 files changed, 51 insertions(+), 287 deletions(-) create mode 100644 changelog/unreleased/fix-builtime-version.md delete mode 100644 glauth/pkg/version/version.go delete mode 100644 graph-explorer/pkg/version/version.go delete mode 100644 graph/pkg/version/version.go delete mode 100644 idp/pkg/version/version.go rename {accounts/pkg => ocis-pkg}/version/version.go (100%) delete mode 100644 ocis/pkg/version/version.go delete mode 100644 ocs/pkg/version/version.go delete mode 100644 proxy/pkg/version/version.go delete mode 100644 settings/pkg/version/version.go delete mode 100644 storage/pkg/version/version.go delete mode 100644 store/pkg/version/version.go delete mode 100644 thumbnails/pkg/version/version.go delete mode 100644 web/pkg/version/version.go delete mode 100644 webdav/pkg/version/version.go diff --git a/.make/go.mk b/.make/go.mk index 4471c071afc..9469448bd51 100644 --- a/.make/go.mk +++ b/.make/go.mk @@ -1,4 +1,5 @@ -IMPORT := github.com/owncloud/ocis/$(NAME) +OCIS_REPO := github.com/owncloud/ocis +IMPORT := ($OCIS_REPO)/$(NAME) BIN := bin DIST := dist @@ -40,8 +41,8 @@ ifndef DATE DATE := $(shell date -u '+%Y%m%d') endif -LDFLAGS += -X google.golang.org/protobuf/reflect/protoregistry.conflictPolicy=warn -s -w -X "$(IMPORT)/pkg/version.String=$(VERSION)" -X "$(IMPORT)/pkg/version.Date=$(DATE)" -DEBUG_LDFLAGS += -X google.golang.org/protobuf/reflect/protoregistry.conflictPolicy=warn -X "$(IMPORT)/pkg/version.String=$(VERSION)" -X "$(IMPORT)/pkg/version.Date=$(DATE)" +LDFLAGS += -X google.golang.org/protobuf/reflect/protoregistry.conflictPolicy=warn -s -w -X "$(OCIS_REPO)/ocis-pkg/version.String=$(VERSION)" -X "$(OCIS_REPO)/ocis-pkg/version.Date=$(DATE)" +DEBUG_LDFLAGS += -X google.golang.org/protobuf/reflect/protoregistry.conflictPolicy=warn -X "$(OCIS_REPO)/ocis-pkg/version.String=$(VERSION)" -X "$(OCIS_REPO)/ocis-pkg/version.Date=$(DATE)" GCFLAGS += all=-N -l diff --git a/accounts/pkg/command/root.go b/accounts/pkg/command/root.go index 54c3055013e..c4757d23e01 100644 --- a/accounts/pkg/command/root.go +++ b/accounts/pkg/command/root.go @@ -7,10 +7,10 @@ import ( "github.com/owncloud/ocis/accounts/pkg/config" "github.com/owncloud/ocis/accounts/pkg/flagset" - "github.com/owncloud/ocis/accounts/pkg/version" ociscfg "github.com/owncloud/ocis/ocis-pkg/config" "github.com/owncloud/ocis/ocis-pkg/log" "github.com/owncloud/ocis/ocis-pkg/sync" + "github.com/owncloud/ocis/ocis-pkg/version" "github.com/spf13/viper" "github.com/thejerf/suture/v4" "github.com/urfave/cli/v2" diff --git a/accounts/pkg/server/http/server.go b/accounts/pkg/server/http/server.go index ccbc3c10f72..b6082c61723 100644 --- a/accounts/pkg/server/http/server.go +++ b/accounts/pkg/server/http/server.go @@ -6,10 +6,10 @@ import ( chimiddleware "github.com/go-chi/chi/v5/middleware" "github.com/owncloud/ocis/accounts/pkg/assets" "github.com/owncloud/ocis/accounts/pkg/proto/v0" - "github.com/owncloud/ocis/accounts/pkg/version" "github.com/owncloud/ocis/ocis-pkg/account" "github.com/owncloud/ocis/ocis-pkg/middleware" "github.com/owncloud/ocis/ocis-pkg/service/http" + "github.com/owncloud/ocis/ocis-pkg/version" ) // Server initializes the http service and server. diff --git a/changelog/unreleased/fix-builtime-version.md b/changelog/unreleased/fix-builtime-version.md new file mode 100644 index 00000000000..c4493b0e513 --- /dev/null +++ b/changelog/unreleased/fix-builtime-version.md @@ -0,0 +1,6 @@ +Bugfix: Fix version information for extensions + +We've fixed the behavior for `ocis version` which previously always showed `0.0.0` as +version for extensions. Now the real version of the extensions are shown. + +https://github.com/owncloud/ocis/pull/2575 diff --git a/glauth/pkg/command/root.go b/glauth/pkg/command/root.go index bcfe9624796..d8b39a9804d 100644 --- a/glauth/pkg/command/root.go +++ b/glauth/pkg/command/root.go @@ -7,10 +7,10 @@ import ( "github.com/owncloud/ocis/glauth/pkg/config" "github.com/owncloud/ocis/glauth/pkg/flagset" - "github.com/owncloud/ocis/glauth/pkg/version" ociscfg "github.com/owncloud/ocis/ocis-pkg/config" "github.com/owncloud/ocis/ocis-pkg/log" "github.com/owncloud/ocis/ocis-pkg/sync" + "github.com/owncloud/ocis/ocis-pkg/version" "github.com/spf13/viper" "github.com/thejerf/suture/v4" "github.com/urfave/cli/v2" diff --git a/glauth/pkg/server/debug/server.go b/glauth/pkg/server/debug/server.go index 6e015277eec..d6373ba1ec7 100644 --- a/glauth/pkg/server/debug/server.go +++ b/glauth/pkg/server/debug/server.go @@ -5,8 +5,8 @@ import ( "net/http" "github.com/owncloud/ocis/glauth/pkg/config" - "github.com/owncloud/ocis/glauth/pkg/version" "github.com/owncloud/ocis/ocis-pkg/service/debug" + "github.com/owncloud/ocis/ocis-pkg/version" ) // Server initializes the debug service and server. diff --git a/glauth/pkg/version/version.go b/glauth/pkg/version/version.go deleted file mode 100644 index 81e81815f46..00000000000 --- a/glauth/pkg/version/version.go +++ /dev/null @@ -1,19 +0,0 @@ -package version - -import ( - "time" -) - -var ( - // String gets defined by the build system. - String = "0.0.0" - - // Date indicates the build date. - Date = "00000000" -) - -// Compiled returns the compile time of this service. -func Compiled() time.Time { - t, _ := time.Parse("20060102", Date) - return t -} diff --git a/graph-explorer/pkg/command/root.go b/graph-explorer/pkg/command/root.go index bb345543713..83cdcb1861f 100644 --- a/graph-explorer/pkg/command/root.go +++ b/graph-explorer/pkg/command/root.go @@ -7,10 +7,10 @@ import ( "github.com/owncloud/ocis/graph-explorer/pkg/config" "github.com/owncloud/ocis/graph-explorer/pkg/flagset" - "github.com/owncloud/ocis/graph-explorer/pkg/version" ociscfg "github.com/owncloud/ocis/ocis-pkg/config" "github.com/owncloud/ocis/ocis-pkg/log" "github.com/owncloud/ocis/ocis-pkg/sync" + "github.com/owncloud/ocis/ocis-pkg/version" "github.com/spf13/viper" "github.com/thejerf/suture/v4" "github.com/urfave/cli/v2" diff --git a/graph-explorer/pkg/server/debug/server.go b/graph-explorer/pkg/server/debug/server.go index 3a07e5021c2..5717db3c7cd 100644 --- a/graph-explorer/pkg/server/debug/server.go +++ b/graph-explorer/pkg/server/debug/server.go @@ -5,8 +5,8 @@ import ( "net/http" "github.com/owncloud/ocis/graph-explorer/pkg/config" - "github.com/owncloud/ocis/graph-explorer/pkg/version" "github.com/owncloud/ocis/ocis-pkg/service/debug" + "github.com/owncloud/ocis/ocis-pkg/version" ) // Server initializes the debug service and server. diff --git a/graph-explorer/pkg/server/http/server.go b/graph-explorer/pkg/server/http/server.go index e58cb69b6a1..ead6bcf7b80 100644 --- a/graph-explorer/pkg/server/http/server.go +++ b/graph-explorer/pkg/server/http/server.go @@ -4,9 +4,9 @@ import ( "github.com/asim/go-micro/v3" chimiddleware "github.com/go-chi/chi/v5/middleware" svc "github.com/owncloud/ocis/graph-explorer/pkg/service/v0" - "github.com/owncloud/ocis/graph-explorer/pkg/version" "github.com/owncloud/ocis/ocis-pkg/middleware" "github.com/owncloud/ocis/ocis-pkg/service/http" + "github.com/owncloud/ocis/ocis-pkg/version" ) // Server initializes the http service and server. diff --git a/graph-explorer/pkg/version/version.go b/graph-explorer/pkg/version/version.go deleted file mode 100644 index 81e81815f46..00000000000 --- a/graph-explorer/pkg/version/version.go +++ /dev/null @@ -1,19 +0,0 @@ -package version - -import ( - "time" -) - -var ( - // String gets defined by the build system. - String = "0.0.0" - - // Date indicates the build date. - Date = "00000000" -) - -// Compiled returns the compile time of this service. -func Compiled() time.Time { - t, _ := time.Parse("20060102", Date) - return t -} diff --git a/graph/pkg/command/root.go b/graph/pkg/command/root.go index be4e64fdb71..c342d81b55b 100644 --- a/graph/pkg/command/root.go +++ b/graph/pkg/command/root.go @@ -10,9 +10,9 @@ import ( "github.com/owncloud/ocis/graph/pkg/config" "github.com/owncloud/ocis/graph/pkg/flagset" - "github.com/owncloud/ocis/graph/pkg/version" ociscfg "github.com/owncloud/ocis/ocis-pkg/config" "github.com/owncloud/ocis/ocis-pkg/log" + "github.com/owncloud/ocis/ocis-pkg/version" "github.com/spf13/viper" "github.com/urfave/cli/v2" ) diff --git a/graph/pkg/server/debug/server.go b/graph/pkg/server/debug/server.go index 80bfd80fb08..fe979c8ee20 100644 --- a/graph/pkg/server/debug/server.go +++ b/graph/pkg/server/debug/server.go @@ -5,8 +5,8 @@ import ( "net/http" "github.com/owncloud/ocis/graph/pkg/config" - "github.com/owncloud/ocis/graph/pkg/version" "github.com/owncloud/ocis/ocis-pkg/service/debug" + "github.com/owncloud/ocis/ocis-pkg/version" ) // Server initializes the debug service and server. diff --git a/graph/pkg/server/http/server.go b/graph/pkg/server/http/server.go index 79af1d2d507..d29e2778adc 100644 --- a/graph/pkg/server/http/server.go +++ b/graph/pkg/server/http/server.go @@ -5,10 +5,10 @@ import ( chimiddleware "github.com/go-chi/chi/v5/middleware" graphMiddleware "github.com/owncloud/ocis/graph/pkg/middleware" svc "github.com/owncloud/ocis/graph/pkg/service/v0" - "github.com/owncloud/ocis/graph/pkg/version" "github.com/owncloud/ocis/ocis-pkg/account" "github.com/owncloud/ocis/ocis-pkg/middleware" "github.com/owncloud/ocis/ocis-pkg/service/http" + "github.com/owncloud/ocis/ocis-pkg/version" ) // Server initializes the http service and server. diff --git a/graph/pkg/version/version.go b/graph/pkg/version/version.go deleted file mode 100644 index 81e81815f46..00000000000 --- a/graph/pkg/version/version.go +++ /dev/null @@ -1,19 +0,0 @@ -package version - -import ( - "time" -) - -var ( - // String gets defined by the build system. - String = "0.0.0" - - // Date indicates the build date. - Date = "00000000" -) - -// Compiled returns the compile time of this service. -func Compiled() time.Time { - t, _ := time.Parse("20060102", Date) - return t -} diff --git a/idp/pkg/command/root.go b/idp/pkg/command/root.go index 990ae4e91a9..640e750356b 100644 --- a/idp/pkg/command/root.go +++ b/idp/pkg/command/root.go @@ -7,10 +7,10 @@ import ( "github.com/owncloud/ocis/idp/pkg/config" "github.com/owncloud/ocis/idp/pkg/flagset" - "github.com/owncloud/ocis/idp/pkg/version" ociscfg "github.com/owncloud/ocis/ocis-pkg/config" "github.com/owncloud/ocis/ocis-pkg/log" "github.com/owncloud/ocis/ocis-pkg/sync" + "github.com/owncloud/ocis/ocis-pkg/version" "github.com/spf13/viper" "github.com/thejerf/suture/v4" "github.com/urfave/cli/v2" diff --git a/idp/pkg/version/version.go b/idp/pkg/version/version.go deleted file mode 100644 index 81e81815f46..00000000000 --- a/idp/pkg/version/version.go +++ /dev/null @@ -1,19 +0,0 @@ -package version - -import ( - "time" -) - -var ( - // String gets defined by the build system. - String = "0.0.0" - - // Date indicates the build date. - Date = "00000000" -) - -// Compiled returns the compile time of this service. -func Compiled() time.Time { - t, _ := time.Parse("20060102", Date) - return t -} diff --git a/accounts/pkg/version/version.go b/ocis-pkg/version/version.go similarity index 100% rename from accounts/pkg/version/version.go rename to ocis-pkg/version/version.go diff --git a/ocis/pkg/command/accounts.go b/ocis/pkg/command/accounts.go index 94a3820221b..a89afa655a9 100644 --- a/ocis/pkg/command/accounts.go +++ b/ocis/pkg/command/accounts.go @@ -8,8 +8,8 @@ import ( svcconfig "github.com/owncloud/ocis/accounts/pkg/config" "github.com/owncloud/ocis/accounts/pkg/flagset" "github.com/owncloud/ocis/ocis-pkg/config" + "github.com/owncloud/ocis/ocis-pkg/version" "github.com/owncloud/ocis/ocis/pkg/register" - "github.com/owncloud/ocis/ocis/pkg/version" "github.com/urfave/cli/v2" ) diff --git a/ocis/pkg/command/glauth.go b/ocis/pkg/command/glauth.go index 5b90aa76a4a..6a69699e548 100644 --- a/ocis/pkg/command/glauth.go +++ b/ocis/pkg/command/glauth.go @@ -5,8 +5,8 @@ import ( svcconfig "github.com/owncloud/ocis/glauth/pkg/config" "github.com/owncloud/ocis/glauth/pkg/flagset" "github.com/owncloud/ocis/ocis-pkg/config" + "github.com/owncloud/ocis/ocis-pkg/version" "github.com/owncloud/ocis/ocis/pkg/register" - "github.com/owncloud/ocis/ocis/pkg/version" "github.com/urfave/cli/v2" ) diff --git a/ocis/pkg/command/idp.go b/ocis/pkg/command/idp.go index f7981eb58e3..46f24ec7b73 100644 --- a/ocis/pkg/command/idp.go +++ b/ocis/pkg/command/idp.go @@ -5,8 +5,8 @@ import ( svcconfig "github.com/owncloud/ocis/idp/pkg/config" "github.com/owncloud/ocis/idp/pkg/flagset" "github.com/owncloud/ocis/ocis-pkg/config" + "github.com/owncloud/ocis/ocis-pkg/version" "github.com/owncloud/ocis/ocis/pkg/register" - "github.com/owncloud/ocis/ocis/pkg/version" "github.com/urfave/cli/v2" ) diff --git a/ocis/pkg/command/ocs.go b/ocis/pkg/command/ocs.go index d4c30e2ddd6..12d39be9222 100644 --- a/ocis/pkg/command/ocs.go +++ b/ocis/pkg/command/ocs.go @@ -5,8 +5,8 @@ package command import ( "github.com/owncloud/ocis/ocis-pkg/config" + "github.com/owncloud/ocis/ocis-pkg/version" "github.com/owncloud/ocis/ocis/pkg/register" - "github.com/owncloud/ocis/ocis/pkg/version" "github.com/owncloud/ocis/ocs/pkg/command" svcconfig "github.com/owncloud/ocis/ocs/pkg/config" "github.com/owncloud/ocis/ocs/pkg/flagset" diff --git a/ocis/pkg/command/proxy.go b/ocis/pkg/command/proxy.go index 0586283e915..8ac4816c53c 100644 --- a/ocis/pkg/command/proxy.go +++ b/ocis/pkg/command/proxy.go @@ -5,8 +5,8 @@ package command import ( "github.com/owncloud/ocis/ocis-pkg/config" + "github.com/owncloud/ocis/ocis-pkg/version" "github.com/owncloud/ocis/ocis/pkg/register" - "github.com/owncloud/ocis/ocis/pkg/version" "github.com/owncloud/ocis/proxy/pkg/command" svcconfig "github.com/owncloud/ocis/proxy/pkg/config" "github.com/owncloud/ocis/proxy/pkg/flagset" diff --git a/ocis/pkg/command/root.go b/ocis/pkg/command/root.go index 25cf42b9eb6..e132e26506b 100644 --- a/ocis/pkg/command/root.go +++ b/ocis/pkg/command/root.go @@ -10,9 +10,9 @@ import ( "github.com/urfave/cli/v2" "github.com/owncloud/ocis/ocis-pkg/config" + "github.com/owncloud/ocis/ocis-pkg/version" "github.com/owncloud/ocis/ocis/pkg/flagset" "github.com/owncloud/ocis/ocis/pkg/register" - "github.com/owncloud/ocis/ocis/pkg/version" "github.com/spf13/viper" ) diff --git a/ocis/pkg/command/settings.go b/ocis/pkg/command/settings.go index f084453fbe0..7970d406a1d 100644 --- a/ocis/pkg/command/settings.go +++ b/ocis/pkg/command/settings.go @@ -5,8 +5,8 @@ package command import ( "github.com/owncloud/ocis/ocis-pkg/config" + "github.com/owncloud/ocis/ocis-pkg/version" "github.com/owncloud/ocis/ocis/pkg/register" - "github.com/owncloud/ocis/ocis/pkg/version" "github.com/owncloud/ocis/settings/pkg/command" svcconfig "github.com/owncloud/ocis/settings/pkg/config" "github.com/owncloud/ocis/settings/pkg/flagset" diff --git a/ocis/pkg/command/store.go b/ocis/pkg/command/store.go index 48e7f3c37e4..74d2a84fed6 100644 --- a/ocis/pkg/command/store.go +++ b/ocis/pkg/command/store.go @@ -5,8 +5,8 @@ package command import ( "github.com/owncloud/ocis/ocis-pkg/config" + "github.com/owncloud/ocis/ocis-pkg/version" "github.com/owncloud/ocis/ocis/pkg/register" - "github.com/owncloud/ocis/ocis/pkg/version" "github.com/owncloud/ocis/store/pkg/command" svcconfig "github.com/owncloud/ocis/store/pkg/config" "github.com/owncloud/ocis/store/pkg/flagset" diff --git a/ocis/pkg/command/thumbnails.go b/ocis/pkg/command/thumbnails.go index c3298af7542..083442f8af4 100644 --- a/ocis/pkg/command/thumbnails.go +++ b/ocis/pkg/command/thumbnails.go @@ -5,8 +5,8 @@ package command import ( "github.com/owncloud/ocis/ocis-pkg/config" + "github.com/owncloud/ocis/ocis-pkg/version" "github.com/owncloud/ocis/ocis/pkg/register" - "github.com/owncloud/ocis/ocis/pkg/version" "github.com/owncloud/ocis/thumbnails/pkg/command" "github.com/owncloud/ocis/thumbnails/pkg/flagset" "github.com/urfave/cli/v2" diff --git a/ocis/pkg/command/webdav.go b/ocis/pkg/command/webdav.go index 4a9663749b9..b84453a5163 100644 --- a/ocis/pkg/command/webdav.go +++ b/ocis/pkg/command/webdav.go @@ -5,8 +5,8 @@ package command import ( "github.com/owncloud/ocis/ocis-pkg/config" + "github.com/owncloud/ocis/ocis-pkg/version" "github.com/owncloud/ocis/ocis/pkg/register" - "github.com/owncloud/ocis/ocis/pkg/version" "github.com/owncloud/ocis/webdav/pkg/command" svcconfig "github.com/owncloud/ocis/webdav/pkg/config" "github.com/owncloud/ocis/webdav/pkg/flagset" diff --git a/ocis/pkg/version/version.go b/ocis/pkg/version/version.go deleted file mode 100644 index 81e81815f46..00000000000 --- a/ocis/pkg/version/version.go +++ /dev/null @@ -1,19 +0,0 @@ -package version - -import ( - "time" -) - -var ( - // String gets defined by the build system. - String = "0.0.0" - - // Date indicates the build date. - Date = "00000000" -) - -// Compiled returns the compile time of this service. -func Compiled() time.Time { - t, _ := time.Parse("20060102", Date) - return t -} diff --git a/ocs/pkg/command/root.go b/ocs/pkg/command/root.go index 4dcb7a95b2a..d7921b159c6 100644 --- a/ocs/pkg/command/root.go +++ b/ocs/pkg/command/root.go @@ -9,8 +9,8 @@ import ( ociscfg "github.com/owncloud/ocis/ocis-pkg/config" "github.com/owncloud/ocis/ocis-pkg/log" + "github.com/owncloud/ocis/ocis-pkg/version" "github.com/owncloud/ocis/ocs/pkg/config" - "github.com/owncloud/ocis/ocs/pkg/version" "github.com/spf13/viper" "github.com/thejerf/suture/v4" "github.com/urfave/cli/v2" diff --git a/ocs/pkg/version/version.go b/ocs/pkg/version/version.go deleted file mode 100644 index 81e81815f46..00000000000 --- a/ocs/pkg/version/version.go +++ /dev/null @@ -1,19 +0,0 @@ -package version - -import ( - "time" -) - -var ( - // String gets defined by the build system. - String = "0.0.0" - - // Date indicates the build date. - Date = "00000000" -) - -// Compiled returns the compile time of this service. -func Compiled() time.Time { - t, _ := time.Parse("20060102", Date) - return t -} diff --git a/proxy/pkg/command/root.go b/proxy/pkg/command/root.go index 19b433cfc99..81a135d7fc3 100644 --- a/proxy/pkg/command/root.go +++ b/proxy/pkg/command/root.go @@ -9,9 +9,9 @@ import ( ociscfg "github.com/owncloud/ocis/ocis-pkg/config" "github.com/owncloud/ocis/ocis-pkg/log" + "github.com/owncloud/ocis/ocis-pkg/version" "github.com/owncloud/ocis/proxy/pkg/config" "github.com/owncloud/ocis/proxy/pkg/flagset" - "github.com/owncloud/ocis/proxy/pkg/version" "github.com/spf13/viper" "github.com/thejerf/suture/v4" "github.com/urfave/cli/v2" diff --git a/proxy/pkg/version/version.go b/proxy/pkg/version/version.go deleted file mode 100644 index 81e81815f46..00000000000 --- a/proxy/pkg/version/version.go +++ /dev/null @@ -1,19 +0,0 @@ -package version - -import ( - "time" -) - -var ( - // String gets defined by the build system. - String = "0.0.0" - - // Date indicates the build date. - Date = "00000000" -) - -// Compiled returns the compile time of this service. -func Compiled() time.Time { - t, _ := time.Parse("20060102", Date) - return t -} diff --git a/settings/pkg/command/root.go b/settings/pkg/command/root.go index 242a841a19c..de90398455f 100644 --- a/settings/pkg/command/root.go +++ b/settings/pkg/command/root.go @@ -9,9 +9,9 @@ import ( ociscfg "github.com/owncloud/ocis/ocis-pkg/config" "github.com/owncloud/ocis/ocis-pkg/log" + "github.com/owncloud/ocis/ocis-pkg/version" "github.com/owncloud/ocis/settings/pkg/config" "github.com/owncloud/ocis/settings/pkg/flagset" - "github.com/owncloud/ocis/settings/pkg/version" "github.com/spf13/viper" "github.com/thejerf/suture/v4" "github.com/urfave/cli/v2" diff --git a/settings/pkg/server/debug/server.go b/settings/pkg/server/debug/server.go index 836322dbf88..e2c16d67b71 100644 --- a/settings/pkg/server/debug/server.go +++ b/settings/pkg/server/debug/server.go @@ -5,8 +5,8 @@ import ( "net/http" "github.com/owncloud/ocis/ocis-pkg/service/debug" + "github.com/owncloud/ocis/ocis-pkg/version" "github.com/owncloud/ocis/settings/pkg/config" - "github.com/owncloud/ocis/settings/pkg/version" ) // Server initializes the debug service and server. diff --git a/settings/pkg/server/http/server.go b/settings/pkg/server/http/server.go index e354129f9a7..17595078ee5 100644 --- a/settings/pkg/server/http/server.go +++ b/settings/pkg/server/http/server.go @@ -7,10 +7,10 @@ import ( "github.com/owncloud/ocis/ocis-pkg/account" "github.com/owncloud/ocis/ocis-pkg/middleware" "github.com/owncloud/ocis/ocis-pkg/service/http" + "github.com/owncloud/ocis/ocis-pkg/version" "github.com/owncloud/ocis/settings/pkg/assets" "github.com/owncloud/ocis/settings/pkg/proto/v0" svc "github.com/owncloud/ocis/settings/pkg/service/v0" - "github.com/owncloud/ocis/settings/pkg/version" ) // Server initializes the http service and server. diff --git a/settings/pkg/version/version.go b/settings/pkg/version/version.go deleted file mode 100644 index 81e81815f46..00000000000 --- a/settings/pkg/version/version.go +++ /dev/null @@ -1,19 +0,0 @@ -package version - -import ( - "time" -) - -var ( - // String gets defined by the build system. - String = "0.0.0" - - // Date indicates the build date. - Date = "00000000" -) - -// Compiled returns the compile time of this service. -func Compiled() time.Time { - t, _ := time.Parse("20060102", Date) - return t -} diff --git a/storage/pkg/command/gateway.go b/storage/pkg/command/gateway.go index f7bfa6c55b8..ae7fc4b85ca 100644 --- a/storage/pkg/command/gateway.go +++ b/storage/pkg/command/gateway.go @@ -13,6 +13,7 @@ import ( "github.com/owncloud/ocis/storage/pkg/tracing" "github.com/owncloud/ocis/ocis-pkg/sync" + "github.com/owncloud/ocis/ocis-pkg/version" "github.com/cs3org/reva/cmd/revad/runtime" "github.com/gofrs/uuid" @@ -64,6 +65,7 @@ func Gateway(cfg *config.Config) *cli.Command { "com.owncloud.storage", uuid.String(), cfg.Reva.Gateway.GRPCAddr, + version.String, logger, ) diff --git a/storage/pkg/command/root.go b/storage/pkg/command/root.go index 23fc4835be4..9d0ee792ae2 100644 --- a/storage/pkg/command/root.go +++ b/storage/pkg/command/root.go @@ -5,9 +5,9 @@ import ( "strings" "github.com/owncloud/ocis/ocis-pkg/log" + "github.com/owncloud/ocis/ocis-pkg/version" "github.com/owncloud/ocis/storage/pkg/config" "github.com/owncloud/ocis/storage/pkg/flagset" - "github.com/owncloud/ocis/storage/pkg/version" "github.com/spf13/viper" "github.com/urfave/cli/v2" ) diff --git a/storage/pkg/command/storagemetadata.go b/storage/pkg/command/storagemetadata.go index d11a5f84c54..96af08f038c 100644 --- a/storage/pkg/command/storagemetadata.go +++ b/storage/pkg/command/storagemetadata.go @@ -12,6 +12,7 @@ import ( "github.com/gofrs/uuid" "github.com/oklog/run" ociscfg "github.com/owncloud/ocis/ocis-pkg/config" + "github.com/owncloud/ocis/ocis-pkg/version" "github.com/owncloud/ocis/storage/pkg/config" "github.com/owncloud/ocis/storage/pkg/flagset" "github.com/owncloud/ocis/storage/pkg/server/debug" @@ -124,6 +125,7 @@ func StorageMetadata(cfg *config.Config) *cli.Command { "com.owncloud.storage.metadata", uuid.Must(uuid.NewV4()).String(), cfg.Reva.StorageMetadata.GRPCAddr, + version.String, logger, ); err != nil { logger.Fatal().Err(err).Msg("failed to register the grpc endpoint") diff --git a/storage/pkg/server/debug/server.go b/storage/pkg/server/debug/server.go index 602a70d9bfa..4a3fa24b3a8 100644 --- a/storage/pkg/server/debug/server.go +++ b/storage/pkg/server/debug/server.go @@ -5,8 +5,8 @@ import ( "net/http" "github.com/owncloud/ocis/ocis-pkg/service/debug" + "github.com/owncloud/ocis/ocis-pkg/version" "github.com/owncloud/ocis/storage/pkg/config" - "github.com/owncloud/ocis/storage/pkg/version" ) // Server initializes the debug service and server. diff --git a/storage/pkg/service/external/external.go b/storage/pkg/service/external/external.go index 1e14bb69916..c4fbd7b0aff 100644 --- a/storage/pkg/service/external/external.go +++ b/storage/pkg/service/external/external.go @@ -13,7 +13,7 @@ import ( // RegisterGRPCEndpoint publishes an arbitrary endpoint to the service-registry. This allows to query nodes of // non-micro GRPC-services like reva. No health-checks are done, thus the caller is responsible for canceling. // -func RegisterGRPCEndpoint(ctx context.Context, serviceID, uuid, addr string, logger log.Logger) error { +func RegisterGRPCEndpoint(ctx context.Context, serviceID, uuid, addr string, version string, logger log.Logger) error { node := ®istry.Node{ Id: serviceID + "-" + uuid, Address: addr, @@ -29,7 +29,7 @@ func RegisterGRPCEndpoint(ctx context.Context, serviceID, uuid, addr string, log service := ®istry.Service{ Name: serviceID, - Version: "", + Version: version, Nodes: []*registry.Node{node}, Endpoints: make([]*registry.Endpoint, 0), } diff --git a/storage/pkg/version/version.go b/storage/pkg/version/version.go deleted file mode 100644 index 81e81815f46..00000000000 --- a/storage/pkg/version/version.go +++ /dev/null @@ -1,19 +0,0 @@ -package version - -import ( - "time" -) - -var ( - // String gets defined by the build system. - String = "0.0.0" - - // Date indicates the build date. - Date = "00000000" -) - -// Compiled returns the compile time of this service. -func Compiled() time.Time { - t, _ := time.Parse("20060102", Date) - return t -} diff --git a/store/pkg/command/root.go b/store/pkg/command/root.go index ea47a2ac68c..a875d5a1bf7 100644 --- a/store/pkg/command/root.go +++ b/store/pkg/command/root.go @@ -9,9 +9,9 @@ import ( ociscfg "github.com/owncloud/ocis/ocis-pkg/config" "github.com/owncloud/ocis/ocis-pkg/log" + "github.com/owncloud/ocis/ocis-pkg/version" "github.com/owncloud/ocis/store/pkg/config" "github.com/owncloud/ocis/store/pkg/flagset" - "github.com/owncloud/ocis/store/pkg/version" "github.com/spf13/viper" "github.com/thejerf/suture/v4" "github.com/urfave/cli/v2" diff --git a/store/pkg/version/version.go b/store/pkg/version/version.go deleted file mode 100644 index 81e81815f46..00000000000 --- a/store/pkg/version/version.go +++ /dev/null @@ -1,19 +0,0 @@ -package version - -import ( - "time" -) - -var ( - // String gets defined by the build system. - String = "0.0.0" - - // Date indicates the build date. - Date = "00000000" -) - -// Compiled returns the compile time of this service. -func Compiled() time.Time { - t, _ := time.Parse("20060102", Date) - return t -} diff --git a/thumbnails/pkg/command/root.go b/thumbnails/pkg/command/root.go index a53a28e5a7d..0e297c5ea5e 100644 --- a/thumbnails/pkg/command/root.go +++ b/thumbnails/pkg/command/root.go @@ -9,8 +9,8 @@ import ( ociscfg "github.com/owncloud/ocis/ocis-pkg/config" "github.com/owncloud/ocis/ocis-pkg/log" + "github.com/owncloud/ocis/ocis-pkg/version" "github.com/owncloud/ocis/thumbnails/pkg/config" - "github.com/owncloud/ocis/thumbnails/pkg/version" "github.com/spf13/viper" "github.com/thejerf/suture/v4" "github.com/urfave/cli/v2" diff --git a/thumbnails/pkg/server/grpc/server.go b/thumbnails/pkg/server/grpc/server.go index 7108f77bff7..866868d12e4 100644 --- a/thumbnails/pkg/server/grpc/server.go +++ b/thumbnails/pkg/server/grpc/server.go @@ -3,11 +3,11 @@ package grpc import ( "github.com/cs3org/reva/pkg/rgrpc/todo/pool" "github.com/owncloud/ocis/ocis-pkg/service/grpc" + "github.com/owncloud/ocis/ocis-pkg/version" "github.com/owncloud/ocis/thumbnails/pkg/proto/v0" svc "github.com/owncloud/ocis/thumbnails/pkg/service/v0" "github.com/owncloud/ocis/thumbnails/pkg/thumbnail/imgsource" "github.com/owncloud/ocis/thumbnails/pkg/thumbnail/storage" - "github.com/owncloud/ocis/thumbnails/pkg/version" ) // NewService initializes the grpc service and server. diff --git a/thumbnails/pkg/version/version.go b/thumbnails/pkg/version/version.go deleted file mode 100644 index 81e81815f46..00000000000 --- a/thumbnails/pkg/version/version.go +++ /dev/null @@ -1,19 +0,0 @@ -package version - -import ( - "time" -) - -var ( - // String gets defined by the build system. - String = "0.0.0" - - // Date indicates the build date. - Date = "00000000" -) - -// Compiled returns the compile time of this service. -func Compiled() time.Time { - t, _ := time.Parse("20060102", Date) - return t -} diff --git a/web/pkg/command/root.go b/web/pkg/command/root.go index d1d3cd83a76..a7b5bbba8af 100644 --- a/web/pkg/command/root.go +++ b/web/pkg/command/root.go @@ -9,8 +9,8 @@ import ( ociscfg "github.com/owncloud/ocis/ocis-pkg/config" "github.com/owncloud/ocis/ocis-pkg/log" + "github.com/owncloud/ocis/ocis-pkg/version" "github.com/owncloud/ocis/web/pkg/config" - "github.com/owncloud/ocis/web/pkg/version" "github.com/spf13/viper" "github.com/thejerf/suture/v4" "github.com/urfave/cli/v2" diff --git a/web/pkg/server/debug/server.go b/web/pkg/server/debug/server.go index 4937b559bbc..43c45036bd3 100644 --- a/web/pkg/server/debug/server.go +++ b/web/pkg/server/debug/server.go @@ -5,8 +5,8 @@ import ( "net/http" "github.com/owncloud/ocis/ocis-pkg/service/debug" + "github.com/owncloud/ocis/ocis-pkg/version" "github.com/owncloud/ocis/web/pkg/config" - "github.com/owncloud/ocis/web/pkg/version" ) // Server initializes the debug service and server. diff --git a/web/pkg/server/http/server.go b/web/pkg/server/http/server.go index fe1d711a6ba..ade4049b4ea 100644 --- a/web/pkg/server/http/server.go +++ b/web/pkg/server/http/server.go @@ -5,9 +5,9 @@ import ( chimiddleware "github.com/go-chi/chi/v5/middleware" "github.com/owncloud/ocis/ocis-pkg/middleware" "github.com/owncloud/ocis/ocis-pkg/service/http" + "github.com/owncloud/ocis/ocis-pkg/version" webmid "github.com/owncloud/ocis/web/pkg/middleware" svc "github.com/owncloud/ocis/web/pkg/service/v0" - "github.com/owncloud/ocis/web/pkg/version" ) // Server initializes the http service and server. diff --git a/web/pkg/version/version.go b/web/pkg/version/version.go deleted file mode 100644 index 81e81815f46..00000000000 --- a/web/pkg/version/version.go +++ /dev/null @@ -1,19 +0,0 @@ -package version - -import ( - "time" -) - -var ( - // String gets defined by the build system. - String = "0.0.0" - - // Date indicates the build date. - Date = "00000000" -) - -// Compiled returns the compile time of this service. -func Compiled() time.Time { - t, _ := time.Parse("20060102", Date) - return t -} diff --git a/webdav/pkg/command/root.go b/webdav/pkg/command/root.go index e5ca8ea5190..99c902e89ef 100644 --- a/webdav/pkg/command/root.go +++ b/webdav/pkg/command/root.go @@ -9,8 +9,8 @@ import ( ociscfg "github.com/owncloud/ocis/ocis-pkg/config" "github.com/owncloud/ocis/ocis-pkg/log" + "github.com/owncloud/ocis/ocis-pkg/version" "github.com/owncloud/ocis/webdav/pkg/config" - "github.com/owncloud/ocis/webdav/pkg/version" "github.com/spf13/viper" "github.com/thejerf/suture/v4" "github.com/urfave/cli/v2" diff --git a/webdav/pkg/version/version.go b/webdav/pkg/version/version.go deleted file mode 100644 index 81e81815f46..00000000000 --- a/webdav/pkg/version/version.go +++ /dev/null @@ -1,19 +0,0 @@ -package version - -import ( - "time" -) - -var ( - // String gets defined by the build system. - String = "0.0.0" - - // Date indicates the build date. - Date = "00000000" -) - -// Compiled returns the compile time of this service. -func Compiled() time.Time { - t, _ := time.Parse("20060102", Date) - return t -}