Skip to content
This repository was archived by the owner on Mar 15, 2024. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 1 addition & 54 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,6 @@ jobs:
- GOCACHE: /tmp/go/cache
steps:
- checkout

- restore_cache:
name: Restoring Cache for vendor
key: gopkg-{{ arch }}-{{ .Branch }}-{{ checksum "Gopkg.lock" }}
paths:
- /go/src/github.com/splunk/vault-plugin-splunk/vendor
- restore_cache:
name: Restoring Cache for build
keys:
- build-cache-{{ arch }}-{{ .Branch }}-{{ .Environment.CIRCLE_PREVIOUS_BUILD_NUM }}
paths:
- /tmp/go/cache

- run:
name: Build
command: make build DEPFLAGS=-v
- run:
name: Wait for Splunk Container
command: curl -4sSk --retry 40 --retry-connrefused --retry-delay 3 -o /dev/null ${SPLUNK_ADDR}
Expand All @@ -49,43 +33,14 @@ jobs:
command: |
export GOVERSION=$(go version | awk '{sub("^go","",$3);print $3;}')
[ -n "$CIRCLE_TAG" ] || tagargs="--snapshot"
scripts/goreleaser --rm-dist --skip-publish $tagargs
rm -rf $(find ./dist/* -type d) dist/config.yaml || true
scripts/goreleaser --rm-dist $tagargs
- store_test_results:
path: test-results/
- store_artifacts:
path: test-results/
- store_artifacts:
path: dist/

- save_cache:
name: Saving Cache for vendor
key: gopkg-{{ arch }}-{{ .Branch }}-{{ checksum "Gopkg.lock" }}
paths:
- /go/src/github.com/splunk/vault-plugin-splunk/vendor
- save_cache:
name: Saving Cache for build
key: build-cache-{{ arch }}-{{ .Branch }}-{{ .Environment.CIRCLE_BUILD_NUM }}
paths:
- /tmp/go/cache

- persist_to_workspace:
root: dist/
paths: .

publish-github-release:
docker:
- image: circleci/golang:1.12
steps:
- attach_workspace:
at: ./artifacts
- run:
name: "Publish Release on GitHub"
command: |
go get github.com/tcnksm/ghr
TAG=v$(echo artifacts/vault-plugin-splunk_*_*.zip | awk -F_ '{print $2;exit;}')
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -recreate ${TAG} ./artifacts/

workflows:
version: 2
workflow:
Expand All @@ -94,11 +49,3 @@ workflows:
filters:
tags:
only: /^v\d+\.\d+\.\d+$/
- publish-github-release:
requires:
- build
filters:
branches:
ignore: /.*/
tags:
only: /^v\d+\.\d+\.\d+$/