summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
41cb4be)
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
Change-Id: I6a3ae140e4155e80433b201bad2650a0f94b22a3
SITE_PATH=${SITE_PATH:-"deploy/site/vm"}
FLUX_SOPS_KEY_NAME=${FLUX_SOPS_KEY_NAME:-"icn-site-vm"}
SITE_PATH=${SITE_PATH:-"deploy/site/vm"}
FLUX_SOPS_KEY_NAME=${FLUX_SOPS_KEY_NAME:-"icn-site-vm"}
+FLUX_SOPS_PRIVATE_KEY="${SCRIPTDIR}/../secrets/sops.asc"
# !!!NOTE!!! THE KEYS USED BELOW ARE FOR TEST PURPOSES ONLY. DO NOT
# USE THESE OUTSIDE OF THIS ICN VIRTUAL TEST ENVIRONMENT.
function build_source {
# First decrypt the existing site YAML, otherwise we'll be
# attempting to encrypt it twice below
# !!!NOTE!!! THE KEYS USED BELOW ARE FOR TEST PURPOSES ONLY. DO NOT
# USE THESE OUTSIDE OF THIS ICN VIRTUAL TEST ENVIRONMENT.
function build_source {
# First decrypt the existing site YAML, otherwise we'll be
# attempting to encrypt it twice below
- if [[ -f ${SCRIPTDIR}/sops.asc ]]; then
- gpg --import ${SCRIPTDIR}/sops.asc
+ if [[ -f ${FLUX_SOPS_PRIVATE_KEY} ]]; then
+ gpg --import ${FLUX_SOPS_PRIVATE_KEY}
sops_decrypt_site ${SCRIPTDIR}/site.yaml
fi
sops_decrypt_site ${SCRIPTDIR}/site.yaml
fi
sops_encrypt_site ${SCRIPTDIR}/site.yaml ${FLUX_SOPS_KEY_NAME}
# ONLY FOR TEST ENVIRONMENT: save the private key used
sops_encrypt_site ${SCRIPTDIR}/site.yaml ${FLUX_SOPS_KEY_NAME}
# ONLY FOR TEST ENVIRONMENT: save the private key used
- export_gpg_private_key ${FLUX_SOPS_KEY_NAME} >${SCRIPTDIR}/sops.asc
+ export_gpg_private_key ${FLUX_SOPS_KEY_NAME} >${FLUX_SOPS_PRIVATE_KEY}
- gpg --import ${SCRIPTDIR}/sops.asc
+ gpg --import ${FLUX_SOPS_PRIVATE_KEY}
flux_create_site ${SITE_REPO} ${SITE_BRANCH} ${SITE_PATH} ${FLUX_SOPS_KEY_NAME}
}
flux_create_site ${SITE_REPO} ${SITE_BRANCH} ${SITE_PATH} ${FLUX_SOPS_KEY_NAME}
}