From 5255c680e0d2579906505f3a2b0ca3b656c5522f Mon Sep 17 00:00:00 2001 From: Patrick Winter Date: Fri, 23 Dec 2016 11:56:35 +0100 Subject: [PATCH] added travisci integration --- .travis.yml | 38 ++++++++++++++++++++++++++++++++++++++ Makefile | 12 ++++++------ sample/vaultrc | 5 +++++ 3 files changed, 49 insertions(+), 6 deletions(-) create mode 100644 .travis.yml create mode 100644 sample/vaultrc diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..877033f --- /dev/null +++ b/.travis.yml @@ -0,0 +1,38 @@ +language: go + +go: 1.7.4 + +sudo: required + +before_install: + - export VAULT_VERSION=0.6.2 + - cp sample/vaultrc ~/.vaultrc + - sudo apt-get update -qqy && sudo apt-get install -qqy unzip + - wget -O - https://keybase.io/hashicorp/pgp_keys.asc | gpg --import + - wget https://releases.hashicorp.com/vault/${VAULT_VERSION}/vault_${VAULT_VERSION}_SHA256SUMS.sig + - wget https://releases.hashicorp.com/vault/${VAULT_VERSION}/vault_${VAULT_VERSION}_linux_amd64.zip + - wget https://releases.hashicorp.com/vault/${VAULT_VERSION}/vault_${VAULT_VERSION}_SHA256SUMS + - gpg --verify vault_${VAULT_VERSION}_SHA256SUMS.sig vault_${VAULT_VERSION}_SHA256SUMS + - bash -c "[[ \"$(sha256sum vault_${VAULT_VERSION}_linux_amd64.zip)\" == \"$(grep + vault_${VAULT_VERSION}_linux_amd64 vault_${VAULT_VERSION}_SHA256SUMS)\" ]] || exit + 1" + - sudo unzip vault_${VAULT_VERSION}_linux_amd64.zip -d /usr/local/bin + +install: + - make install + +before_script: + - vault server -dev -dev-root-token-id="password" & + +script: + - make test + - make build + +deploy: + provider: releases + api_key: + secure: H514x+zUvUtT2xeJmqIanrMXtsvGroA/Bk5eAwNkVbz+2bL9Aj9tUSSpTvMka34lo+IdBDK0lpITDNooEmdlyCPRtJx/wAavSjKTquq+K0isXXCv4m/w7L3Gxhd5Xwq1ZEg4gB3cyQOoRTSLeopWqtx1EJ0gnF7MZL4IQ93zJL44YYBDVCp0mPoBOKmk6k6+vWhvmkHyepIGNriXM4kwm69mByrRdUb+YTyYl0wBKV7jW6zuoiWX2srFkArP1tyB4kc0Gc8+SIzoB1DykFw99cmN2H3DS5acG6omindaWE1izFodsv/Ar5B66mKCxd8AVPNGNe548PJl9FEW2pMF2P++4oQthu5vBDFx85h7ecvj/xBpObnPldxty4gn371ee0BwCDwTMoXKBupwJmbOwD5UE5ibxGNVj3n0YnrwCJ+56eUzibuCsLTI2/TvfJLp/nKKZtFFS5xmhvIGJR5+xT6+th8dG5DgpGGYJ36sTEwBcGBplSvqsF3iSb1dE8hpNN8/rTi43z5kPm4B90+17nS7LzvfLQozMChLru5xRD2WocwzkNUa9qST2qaJbkSvq9UMZepkKsuvC7qtoQhMesbwzFgTNEBsqHp61q6RIJYOh9enHjf6ejyE2YAksQLTOBK/hOp/RL1vk6f7lhpL/UX5lHVnE+qUZrQ8e+KQcfM= + file: vc + on: + tags: true + diff --git a/Makefile b/Makefile index c22b214..25a395c 100644 --- a/Makefile +++ b/Makefile @@ -1,15 +1,15 @@ -.PHONY: help test-all dependencies +.PHONY: help test-all dependencies build install help: @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' -test-all: ## Runs all tests +test: ## Runs all tests go test src/*.go -build: ## Compiles the program - go build -o vc src/*.go - -dependencies: ## install go dependencies +install: ## Installs go dependencies for dep in gopkg.in/yaml.v2 github.com/hashicorp/vault/api github.com/mitchellh/cli; do \ go get $$dep; \ done + +build: ## Compiles the program + go build -o vc src/*.go diff --git a/sample/vaultrc b/sample/vaultrc new file mode 100644 index 0000000..7818f06 --- /dev/null +++ b/sample/vaultrc @@ -0,0 +1,5 @@ +host: 127.0.0.1 +port: 8200 +token: password +tls: false +verify_tls: false