This repository was archived by the owner on Mar 15, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +69
-3
lines changed Expand file tree Collapse file tree 4 files changed +69
-3
lines changed Original file line number Diff line number Diff line change 1+ version : 2
2+
3+ defaultenv : &defaultenv
4+ environment :
5+ SPLUNK_ADDR : https://localhost:8089
6+ SPLUNK_PASSWORD : test1234
7+ SPLUNK_START_ARGS : --accept-license
8+
9+ jobs :
10+ build :
11+ working_directory : /go/src/github.com/splunk/vault-plugin-splunk
12+ docker :
13+ - image : circleci/golang:1.12
14+ << : *defaultenv
15+ - image : splunk/splunk:latest
16+ user : root
17+ << : *defaultenv
18+ environment :
19+ - GOCACHE : /tmp/go/cache
20+ steps :
21+ - checkout
22+
23+ - restore_cache :
24+ name : Restoring Cache for vendor
25+ key : gopkg-{{ arch }}-{{ .Branch }}-{{ checksum "Gopkg.lock" }}
26+ paths :
27+ - /go/src/github.com/splunk/vault-plugin-splunk/vendor
28+ - restore_cache :
29+ name : Restoring Cache for build
30+ keys :
31+ - build-cache-{{ arch }}-{{ .Branch }}-{{ .Environment.CIRCLE_PREVIOUS_BUILD_NUM }}
32+ paths :
33+ - /tmp/go/cache
34+
35+ - run :
36+ name : Build
37+ command : make build DEPFLAGS=-v
38+ - run :
39+ name : Wait for Splunk Container
40+ command : curl -4sSk --retry 40 --retry-connrefused --retry-delay 3 -o /dev/null ${SPLUNK_ADDR}
41+ - run :
42+ name : Test
43+ command : make test TESTREPORT=test-results/go/results.xml
44+ - store_test_results :
45+ path : test-results/
46+ - store_artifacts :
47+ path : test-results/
48+
49+ - save_cache :
50+ name : Saving Cache for vendor
51+ key : gopkg-{{ arch }}-{{ .Branch }}-{{ checksum "Gopkg.lock" }}
52+ paths :
53+ - /go/src/github.com/splunk/vault-plugin-splunk/vendor
54+ - save_cache :
55+ name : Saving Cache for build
56+ key : build-cache-{{ arch }}-{{ .Branch }}-{{ .Environment.CIRCLE_BUILD_NUM }}
57+ paths :
58+ - /tmp/go/cache
Original file line number Diff line number Diff line change 1717/vendor /
1818
1919/vault.hcl
20+ /test-results.xml
21+ /test-results /
Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ VERSION := 0.1.0
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
5+ TESTREPORT := test-results.xml
6+
57# XXX BUG(mweber) "go env GOBIN" is empty?
68GOBIN := $(shell go env GOPATH) /bin
79
@@ -16,7 +18,7 @@ all: dep build lint test
1618
1719.PHONY : dep
1820dep : prereq
19- dep ensure
21+ dep ensure $( DEPFLAGS )
2022
2123.PHONY : build
2224build : dep vault.hcl
@@ -37,7 +39,8 @@ dev: build
3739.PHONY : test
3840test : build
3941 @test -n " $$ SPLUNK_ADDR" || { echo ' warning: SPLUNK_ADDR not set, creating new Splunk instances. This will be slow.' ; }
40- go test -v ./...
42+ mkdir -p $(dir $(TESTREPORT ) )
43+ gotestsum --junitfile $(TESTREPORT ) -- -cover -v ./...
4144
4245.PHONY : lint
4346lint : dep
@@ -48,8 +51,9 @@ lint: dep
4851prereq :
4952 go get github.com/golang/dep/cmd/dep
5053 go get golang.org/x/lint/golint
54+ go get gotest.tools/gotestsum
5155
5256.PHONY : clean
5357clean :
5458 # XXX clean
55- rm -rf vault.hcl vendor/
59+ rm -rf vault.hcl $( TESTREPORT ) vendor/
Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ vault-plugin-splunk
44A Hashicorp Vault[ 1] plugin that aims to securely manage Splunk admin
55accounts, including secrets rotation for compliance purposes.
66
7+ [ ![ CircleCI] ( https://circleci.com/gh/splunk/vault-plugin-splunk.svg?style=svg )] ( https://circleci.com/gh/splunk/vault-plugin-splunk )
8+
79[ 1] https://www.vaultproject.io/
810
911# Building from Source
You can’t perform that action at this time.
0 commit comments