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

A few dev environment tweaks #521

Merged
merged 1 commit into from
Mar 18, 2020
Merged
Show file tree
Hide file tree
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
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