Skip to content

Commit

Permalink
Merge pull request #1 from joemiller/gcp-cloud-hsm-mvp
Browse files Browse the repository at this point in the history
initial working implementation of Google Cloud KMS signing key support
  • Loading branch information
joemiller authored Oct 16, 2018
2 parents aae158d + d5192cf commit aff9442
Show file tree
Hide file tree
Showing 20 changed files with 1,467 additions and 142 deletions.
110 changes: 110 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
version: 2
jobs:
deps:
docker:
- image: circleci/golang:1.11
working_directory: ~/app
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "go.sum" }}
- run: go get -v
- save_cache:
key: v1-dependencies-{{ checksum "go.sum" }}
paths:
- /go/pkg/mod
- persist_to_workspace:
root: .
paths:
- ./

test-unit:
docker:
- image: circleci/golang:1.11
working_directory: ~/app
steps:
- attach_workspace:
at: .
- restore_cache:
keys:
- v1-dependencies-{{ checksum "go.sum" }}
- run: make test

test-acceptance:
docker:
- image: circleci/golang:1.11
working_directory: ~/app
steps:
- attach_workspace:
at: .
- restore_cache:
keys:
- v1-dependencies-{{ checksum "go.sum" }}
- run: echo "$GOOGLE_SERVICE_ACCOUNT_CREDS" | base64 --decode >/tmp/svc-account.json
- run:
command: make test
environment:
VAULT_ACC: "1"
TEST_GOOGLE_CREDENTIALS_FILE: /tmp/svc-account.json

build:
docker:
- image: circleci/golang:1.11
working_directory: ~/app
steps:
- attach_workspace:
at: .
- restore_cache:
keys:
- v1-dependencies-{{ checksum "go.sum" }}
- run: make build
- persist_to_workspace:
root: .
paths:
- ./

release:
docker:
- image: circleci/golang:1.11
working_directory: ~/app
steps:
- attach_workspace:
at: .
- restore_cache:
keys:
- v1-dependencies-{{ checksum "go.sum" }}
- run: |
curl -s https://api.github.com/repos/pantheon-systems/autotag/releases/latest | \
grep browser_download | \
grep -i linux | \
cut -d '"' -f 4 | \
xargs curl -o ~/autotag -L \
&& chmod 755 ~/autotag
- run: ~/autotag
- run: curl -sL https://git.io/goreleaser | bash -s -- --parallelism=2

workflows:
version: 2
primary:
jobs:
- deps
- test-unit:
requires:
- deps
- test-acceptance:
requires:
- deps
- build:
requires:
- deps
- release:
requires:
- test-unit
- test-acceptance
- build
filters:
branches:
only:
- master
- gcp-cloud-hsm-mvp
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
bin/
*.pem
*.crt
*.key
.envrc
tmp-intermediate
tmp-rootca
Attic
dist/
.vscode/
test-svcaccount.json
.env
43 changes: 43 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
builds:
- env:
- CGO_ENABLED=0
ldflags:
# Default is `-s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}}`.
- -s -w
goos:
- linux
- darwin
- windows
# - freebsd
# - openbsd
# - dragonfly
# - netbsd
goarch:
# - 386
- amd64
# - arm
# - arm64
ignore:
- goos: darwin
goarch: 386
- goos: windows
goarch: 386
archive:
replacements:
386: i386
format_overrides:
- goos: windows
format: zip

checksum:
name_template: 'checksums.txt'

snapshot:
name_template: "{{ .Tag }}-next"

changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
12 changes: 10 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
APP := vault-cloud-kms-pki
APP := vault-gcp-cloud-kms-pki

test:
@go test -v ./...

build:
@CGO_ENABLED=0 go build -o bin/$(APP)

build-debug:
@go build -a -gcflags='-N -l' -o bin/$(APP)

build-linux:
@GOOS=linux GOOARCH=amd64 CGO_ENABLED=0 go build -o bin/$(APP)

release-snapshot:
@rm -rf ./dist
@goreleaser --snapshot

run-dev: build
sh ./run-dev.sh

.PHONY: all test build build-linux
.PHONY: all test build build-linux release-snapshot
Loading

0 comments on commit aff9442

Please sign in to comment.