Skip to content

Commit

Permalink
fix: set version during release build and register version handler (#714
Browse files Browse the repository at this point in the history
)
  • Loading branch information
zepatrik authored Sep 15, 2021
1 parent fceb7c2 commit 8091475
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ builds:
- -tags
- sqlite
ldflags:
- -s -w -X github.com/ory/keto/driver/config.Version={{.Tag}} -X github.com/ory/keto/driver/config.Commit={{.FullCommit}} -X github.com/ory/keto/driver/config.Date={{.Date}}
- -s -w -X github.com/ory/keto/internal/driver/config.Version={{.Tag}} -X github.com/ory/keto/internal/driver/config.Commit={{.FullCommit}} -X github.com/ory/keto/internal/driver/config.Date={{.Date}}
# - "-extldflags '-static'"
binary: keto
env:
Expand All @@ -35,7 +35,7 @@ builds:
- -tags
- sqlite
ldflags:
- -s -w -X github.com/ory/keto/driver/config.Version={{.Tag}} -X github.com/ory/keto/driver/config.Commit={{.FullCommit}} -X github.com/ory/keto/driver/config.Date={{.Date}}
- -s -w -X github.com/ory/keto/internal/driver/config.Version={{.Tag}} -X github.com/ory/keto/internal/driver/config.Commit={{.FullCommit}} -X github.com/ory/keto/internal/driver/config.Date={{.Date}}
binary: keto
env:
- CGO_ENABLED=1
Expand All @@ -49,7 +49,7 @@ builds:
- -tags
- sqlite
ldflags:
- -s -w -X github.com/ory/keto/driver/config.Version={{.Tag}} -X github.com/ory/keto/driver/config.Commit={{.FullCommit}} -X github.com/ory/keto/driver/config.Date={{.Date}}
- -s -w -X github.com/ory/keto/internal/driver/config.Version={{.Tag}} -X github.com/ory/keto/internal/driver/config.Commit={{.FullCommit}} -X github.com/ory/keto/internal/driver/config.Date={{.Date}}
binary: keto
env:
- CGO_ENABLED=1
Expand All @@ -64,7 +64,7 @@ builds:
- -tags
- sqlite
ldflags:
- -s -w -X github.com/ory/keto/driver/config.Version={{.Tag}} -X github.com/ory/keto/driver/config.Commit={{.FullCommit}} -X github.com/ory/keto/driver/config.Date={{.Date}}
- -s -w -X github.com/ory/keto/internal/driver/config.Version={{.Tag}} -X github.com/ory/keto/internal/driver/config.Commit={{.FullCommit}} -X github.com/ory/keto/internal/driver/config.Date={{.Date}}
- "-extldflags '-static'"
binary: keto
env:
Expand All @@ -79,7 +79,7 @@ builds:
-
id: keto
ldflags:
- -s -w -X github.com/ory/keto/driver/config.Version={{.Tag}} -X github.com/ory/keto/driver/config.Commit={{.FullCommit}} -X github.com/ory/keto/driver/config.Date={{.Date}}
- -s -w -X github.com/ory/keto/internal/driver/config.Version={{.Tag}} -X github.com/ory/keto/internal/driver/config.Commit={{.FullCommit}} -X github.com/ory/keto/internal/driver/config.Date={{.Date}}
binary: keto
env:
- CGO_ENABLED=0
Expand Down
2 changes: 2 additions & 0 deletions internal/driver/registry_default.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ func (r *RegistryDefault) ReadRouter() http.Handler {
br := &x.ReadRouter{Router: httprouter.New()}

r.HealthHandler().SetHealthRoutes(br.Router, false)
r.HealthHandler().SetVersionRoutes(br.Router)

for _, h := range r.allHandlers() {
h.RegisterReadRoutes(br)
Expand All @@ -351,6 +352,7 @@ func (r *RegistryDefault) WriteRouter() http.Handler {
pr := &x.WriteRouter{Router: httprouter.New()}

r.HealthHandler().SetHealthRoutes(pr.Router, false)
r.HealthHandler().SetVersionRoutes(pr.Router)

for _, h := range r.allHandlers() {
h.RegisterWriteRoutes(pr)
Expand Down

0 comments on commit 8091475

Please sign in to comment.