diff --git a/.make/go.mk b/.make/go.mk index 4471c071a..9469448bd 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 54c305501..c4757d23e 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 ccbc3c10f..b6082c617 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 000000000..c4493b0e5 --- /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 bcfe96247..d8b39a980 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 6e015277e..d6373ba1e 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 81e81815f..000000000 --- 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 bb3455437..83cdcb186 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 3a07e5021..5717db3c7 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 e58cb69b6..ead6bcf7b 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 81e81815f..000000000 --- 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 be4e64fdb..c342d81b5 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 80bfd80fb..fe979c8ee 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 79af1d2d5..d29e2778a 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 81e81815f..000000000 --- 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 990ae4e91..640e75035 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 81e81815f..000000000 --- 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 94a382022..a89afa655 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 5b90aa76a..6a69699e5 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 f7981eb58..46f24ec7b 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 d4c30e2dd..12d39be92 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 0586283e9..8ac4816c5 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 25cf42b9e..e132e2650 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 f084453fb..7970d406a 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 48e7f3c37..74d2a84fe 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 c3298af75..083442f8a 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 4a9663749..b84453a51 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 81e81815f..000000000 --- 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 4dcb7a95b..d7921b159 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 81e81815f..000000000 --- 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 19b433cfc..81a135d7f 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 81e81815f..000000000 --- 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 242a841a1..de9039845 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 836322dbf..e2c16d67b 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 e354129f9..17595078e 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 81e81815f..000000000 --- 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 f7bfa6c55..ae7fc4b85 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 23fc4835b..9d0ee792a 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 d11a5f84c..96af08f03 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 602a70d9b..4a3fa24b3 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 1e14bb699..c4fbd7b0a 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 81e81815f..000000000 --- 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 ea47a2ac6..a875d5a1b 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 81e81815f..000000000 --- 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 a53a28e5a..0e297c5ea 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 7108f77bf..866868d12 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 81e81815f..000000000 --- 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 d1d3cd83a..a7b5bbba8 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 4937b559b..43c45036b 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 fe1d711a6..ade4049b4 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 81e81815f..000000000 --- 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 e5ca8ea51..99c902e89 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 81e81815f..000000000 --- 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 -}