Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Commit

Permalink
Merge pull request #521 from Conky5/a-few-tweaks
Browse files Browse the repository at this point in the history
A few dev environment tweaks
  • Loading branch information
Conky5 authored Mar 18, 2020
2 parents d9ccb5a + 28dab96 commit ae168e4
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ elastic-certificates.p12
index.yaml
*.tgz
.idea/
/venv
5 changes: 5 additions & 0 deletions helpers/terraform/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ export TF_VAR_kubernetes_version=$(KUBERNETES_VERSION)
help: ## Display this help
@awk 'BEGIN {FS = ":.*##"; printf "Usage: make \033[36m<target>\033[0m\n\nTargets:\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-10s\033[0m %s\n", $$1, $$2 }' $(MAKEFILE_LIST)

.PHONY: clean
clean: ## Delete terraform working directory and local state files
rm credentials.json
rm -rf .terraform/

credentials.json:
vault read -field=value \
"secret/devops-ci/helm-charts/gce/service-account" \
Expand Down
16 changes: 14 additions & 2 deletions helpers/terraform/in-docker
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,24 @@

[[ -n $DEBUG ]] && set -o xtrace

if [[ -z $VAULT_ADDR ]]
then
echo "VAULT_ADDR must be set."
exit 1
fi

if [[ -z $VAULT_TOKEN ]]
then
echo "VAULT_TOKEN must be set."
exit 1
fi

make build

docker run --rm --interactive \
--env GOOGLE_CREDENTIALS='credentials.json' \
--env VAULT_TOKEN=${VAULT_TOKEN} \
--env VAULT_ADDR=${VAULT_ADDR} \
--env VAULT_TOKEN="${VAULT_TOKEN}" \
--env VAULT_ADDR="${VAULT_ADDR}" \
--env HOME=/app \
--volume "${PWD}/../../:/app" \
--user "$(id -u):$(id -g)" \
Expand Down

0 comments on commit ae168e4

Please sign in to comment.