-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Preparing CI and scripts to install Vault, and bootstrap service to have AppRole authentication. Role-ID and Secret-ID are saved on `.env` and employed during CI steps.
- Loading branch information
Otávio Fernandes
committed
Mar 30, 2019
1 parent
4bf50c3
commit 5facb00
Showing
7 changed files
with
106 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
|
||
VAULT_VERSION="${VAULT_VERSOIN:-1.1.0}" | ||
VAULT_TARGET_DIR="${VAULT_TARGET_DIR:-/home/travis/bin}" | ||
|
||
VAULT_ZIP_FILE="vault_${VAULT_VERSION}_linux_amd64.zip" | ||
VAULT_BIN="vault" | ||
|
||
function die () { | ||
echo "[ERROR] ${*}" 1>&2 | ||
exit 1 | ||
} | ||
|
||
[ ! -d ${VAULT_TARGET_DIR} ] && die "Can't find target directory at '${VAULT_TARGET_DIR}'!" | ||
|
||
if ! wget "https://releases.hashicorp.com/vault/${VAULT_VERSION}/${VAULT_ZIP_FILE}" ; then | ||
die "Can't download Vault!" | ||
fi | ||
|
||
if ! unzip ${VAULT_ZIP_FILE} ; then | ||
die "Can't unzip '${VAULT_ZIP_FILE}'" | ||
fi | ||
|
||
[ ! -f ${VAULT_BIN} ] && die "Can't find vault binary at './${VAULT_BIN}'" | ||
|
||
if ! mv -v "${VAULT_BIN}" "${VAULT_TARGET_DIR}" ; then | ||
die "Can't move '${VAULT_BIN}' to '${VAULT_TARGET_DIR}'!" | ||
fi | ||
|
||
rm -vf "${VAULT_ZIP_FILE}" > /dev/null 2>&1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,8 @@ | |
.git* | ||
.goreleaser* | ||
.vscode | ||
.ci | ||
.cover* | ||
README.md | ||
build | ||
test | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
build/ | ||
coverage* | ||
vendor* | ||
.ci/codecov* | ||
.data | ||
.env | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
language: go | ||
go: | ||
- 1.11.x | ||
install: true | ||
services: | ||
- docker | ||
before_script: | ||
- docker-compose up -d | ||
- .ci/install-vault.sh | ||
- .ci/bootstrap-vault.sh | ||
- make dep | ||
script: | ||
- export VAULT_HANDLER_VAULT_ROLE_ID=$(grep ROLE_ID .env |awk -F '"' '{print $2}') | ||
- export VAULT_HANDLER_VAULT_SECRET_ID=$(grep SECRET_ID .env |awk -F '"' '{print $2}') | ||
- make bootstrap | ||
- make | ||
- make test | ||
# - make integration | ||
after_success: | ||
- make codecov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters