This repository was archived by the owner on Mar 15, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +52
-1
lines changed Expand file tree Collapse file tree 3 files changed +52
-1
lines changed Original file line number Diff line number Diff line change 4848 path : test-results/
4949 - store_artifacts :
5050 path : test-results/
51+ - store_artifacts :
52+ path : /go/bin/vault-plugin-splunk
5153
5254 - save_cache :
5355 name : Saving Cache for vendor
5961 key : build-cache-{{ arch }}-{{ .Branch }}-{{ .Environment.CIRCLE_BUILD_NUM }}
6062 paths :
6163 - /tmp/go/cache
64+
65+ - persist_to_workspace :
66+ root : /go/bin
67+ # Must be relative path from root
68+ paths :
69+ - vault-plugin-splunk
70+
71+ publish-github-release :
72+ docker :
73+ - image : cibuilds/github:0.10
74+ steps :
75+ - attach_workspace :
76+ at : ./artifacts
77+ - run :
78+ name : " Publish Release on GitHub"
79+ command : |
80+ VERSION=$(artifacts/vault-plugin-splunk -version)
81+ ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete ${VERSION} ./artifacts/
82+
83+ workflows :
84+ version : 2
85+ tagged-build :
86+ jobs :
87+ - build :
88+ filters :
89+ tags :
90+ only : /^\d+\.\d+\.\d+$/
91+ - publish-github-release :
92+ requires :
93+ - build
94+ filters :
95+ branches :
96+ ignore : /.*/
97+ tags :
98+ only : /^\d+\.\d+\.\d+$/
Original file line number Diff line number Diff line change 1- VERSION := 0.1.0
1+ VERSION := $( shell git describe --tags --always 2>/dev/null)
22SHORT_COMMIT := $(shell git rev-parse --short HEAD 2>/dev/null || echo dev)
33GO_VERSION := $(shell go version | awk '{ print $$3}' | sed 's/^go//')
44
Original file line number Diff line number Diff line change 11package main
22
33import (
4+ "fmt"
45 "os"
56
67 "github.com/hashicorp/go-hclog"
@@ -10,13 +11,26 @@ import (
1011 splunk "github.com/splunk/vault-plugin-splunk"
1112)
1213
14+ var (
15+ version string
16+ goVersion string
17+ )
18+
1319func main () {
1420 apiClientMeta := & pluginutil.APIClientMeta {}
1521 flags := apiClientMeta .FlagSet ()
22+ printVersion := flags .Bool ("version" , false , "Prints version" )
23+
1624 // all plugins ignore Parse errors
1725 // #nosec G104
1826 flags .Parse (os .Args [1 :])
1927
28+ switch {
29+ case * printVersion :
30+ fmt .Printf ("%s %s (golang %s)\n " , os .Args [0 ], version , goVersion )
31+ os .Exit (0 )
32+ }
33+
2034 tlsConfig := apiClientMeta .GetTLSConfig ()
2135 tlsProviderFunc := pluginutil .VaultPluginTLSProvider (tlsConfig )
2236
You can’t perform that action at this time.
0 commit comments