Skip to content

Commit

Permalink
feat: Add a version to the plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
ilijamt committed Sep 3, 2023
1 parent c457934 commit 98bc87e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ builds:
- -trimpath
ldflags:
- '-s -w'
- "-X 'github.com/ilijamt/vault-plugin-secrets-gitlab.Version={{ .Version }}'"
- "-X 'github.com/ilijamt/vault-plugin-secrets-gitlab.FullCommit={{ .FullCommit }}'"
- "-X 'github.com/ilijamt/vault-plugin-secrets-gitlab.BuildDate={{ .Date }}'"
goos:
- windows
- linux
Expand Down
7 changes: 4 additions & 3 deletions backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ func Factory(ctx context.Context, conf *logical.BackendConfig) (logical.Backend,
}

b.Backend = &framework.Backend{
BackendType: logical.TypeLogical,
Help: strings.TrimSpace(backendHelp),
Invalidate: b.Invalidate,
BackendType: logical.TypeLogical,
Help: strings.TrimSpace(backendHelp),
RunningVersion: RunningVersion,
Invalidate: b.Invalidate,

PathsSpecial: &logical.Paths{
LocalStorage: []string{
Expand Down
1 change: 1 addition & 0 deletions backend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ func TestBackend(t *testing.T) {
require.True(t, fv.IsNil())
b.SetClient(newInMemoryClient(true))
require.False(t, fv.IsNil())
require.EqualValues(t, gitlab.RunningVersion, b.PluginVersion().Version)
}
5 changes: 5 additions & 0 deletions version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package gitlab

var RunningVersion string = "v0.0.0-dev"
var FullCommit string
var BuildDate string

0 comments on commit 98bc87e

Please sign in to comment.