Skip to content

Commit

Permalink
Reworked vault prefix for pipeline.
Browse files Browse the repository at this point in the history
  • Loading branch information
wayneeseguin committed Dec 20, 2022
1 parent ebb98e7 commit 2696d9c
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions hooks/blueprint
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,15 @@ template::render::env::vault() {
}

ocfp::vault::prefix() {
[[ -z "${OCFP_VAULT_PREFIX:-}" ]] || return 0

if want_feature sharded-vault-paths
then
then # Madness. Not a best practice. Don't do this.
DEPLOYMENTS_PATH="${DEPLOYMENTS_PATH:-"${HOME}/deployments"}"

[[ -d "${DEPLOYMENTS_PATH}/bosh/.genesis/manifests" ]] ||
fail "No deployment manifests found at ${DEPLOYMENTS_PATH}/bosh/.genesis/manifests!"

OCFP_VAULT_PREFIX=$(
cat ${DEPLOYMENTS_PATH}/bosh/.genesis/manifests/${OCFP_ENV_NAME}.yml |
spruce json | jq -r '.genesis.secrets_mount' | sed -e 's#^/##' -e 's#/$##'
Expand All @@ -79,11 +86,7 @@ set -eu

declare feature env_name mgmt_env
declare -a yamls opsfiles ocf_envs fqdns
declare -x OCFP_VAULT_PREFIX OCFP_ENV_NAME OCFP_ENV_PATH DEPLOYMENTS_PATH

DEPLOYMENTS_PATH="${DEPLOYMENTS_PATH:-"${HOME}/deployments"}"
[[ -d "${DEPLOYMENTS_PATH}/bosh/.genesis/manifests" ]] ||
fail "No deployment manifests found at ${DEPLOYMENTS_PATH}/bosh/.genesis/manifests!"
declare -x OCFP_VAULT_PREFIX OCFP_ENV_NAME OCFP_ENV_PATH DEPLOYMENTS_PATH OCFP_VAULT_PREFIX

yamls=()
opsfiles=()
Expand Down

0 comments on commit 2696d9c

Please sign in to comment.