adds auto-find for secrets files, fix

ADP-216-uat-sops-step2_003
LeeW 10 months ago
parent a552532c40
commit 6a5952bcea

@ -185,7 +185,7 @@ function main(){
# locate appropriate sops config if default assumption not found # locate appropriate sops config if default assumption not found
# dev note: '2> /dev/null' to disable debug output # dev note: '2> /dev/null' to disable debug output
sops_config="$(fn_sops_locate_config_in_git_repo 2> /dev/null)" sops_config="$(fn_sops_locate_config_in_git_repo 2> /dev/null)"
sops_config_dir="$(basename "${sops_config}")" sops_config_dir="$(dirname "${sops_config}")"
fi fi
# Paths to Secrets Files # Paths to Secrets Files
@ -195,7 +195,6 @@ function main(){
done done
fi fi
if [[ "${opt_find_secrets}" -eq 1 ]]; then if [[ "${opt_find_secrets}" -eq 1 ]]; then
found_secrets_file_list="$(find "${sops_config_dir}" -name secrets.yaml)"
secrets_file_list+=("$(find "${sops_config_dir}" -name secrets.yaml)") secrets_file_list+=("$(find "${sops_config_dir}" -name secrets.yaml)")
fi fi
# /VALIDATE INPUTS # /VALIDATE INPUTS

@ -90,7 +90,7 @@ if [[ 1 -eq 1 ]]; then
set +e set +e
# move 'set -x' within the sub-shell, otherwise all output dumped to tty # move 'set -x' within the sub-shell, otherwise all output dumped to tty
# ... bug: stderr still gets printed, not sure why. E.g. '# RUN: sops updatekeys mock_secrets.yaml' # ... bug: stderr still gets printed, not sure why. E.g. '# RUN: sops updatekeys mock_secrets.yaml'
_out="$(set -x; ../bin/update_sops.sh -c "${PWD}" --find_secrets "${secrets_file}" 2>&1 )" _out="$(set -x; ../bin/update_sops.sh --find_secrets -s "${secrets_file}" 2>&1 )"
# re-enable strict # re-enable strict
set -e set -e
set +x set +x

Loading…
Cancel
Save