You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe
Though @SUMMONENVFILE has been useful until now it has some shortcomings
Still breaks on multiline secret value
Doesn’t support the !file tag
A better approach would be something like @SUMMONDOCKEROPTS , whose usage would look like this summon docker run @SUMMONDOCKEROPTS myorg/myimage
It would
Add -e VAR_NAME for all the secrets injected by summon 2. Add -v FILE_PATH:FILE_PATH for all the secrets that are managed as files by summon 3. The benefit of (2) is that summon is still managing these files so if it dies then those files are gone.
Lifting environment variables from summon into your docker container has never been easier. It even works with !file .
function summon_envvars_docker_opts() {
( set -euo pipefail
local secretsyml="${1:-secrets.yml}"
if ! cat ${secretsyml} | sed '/^$/d' | { grep '^[^#]' || true; } | sed -E 's/^([^:]*)?.*/\1/' | xargs -n 1 sh -c 'printenv $1 > /dev/null' _; then
echo "failed: ensure that '${secretsyml}' exists and that this script is running within a summon context i.e. summon [this script]" >&2
exit 1
fi
# create the options for the environment variables listed in secrets.yml
envs="$(cat ${secretsyml}| sed '/^$/d' | { grep '^[^#]' || true; } | sed -E 's/^([^:]*)?.*/\1/' | xargs printf -- '-e %s ')"
# create the options for the volume mounts for secrets that use the !file tag in secrets.yml
volumemounts="$(cat ${secretsyml} | { grep '^[^#]' || true; } | { grep '![^ ]*file' || true; } | sed '/^$/d' | sed -E 's/^([^:]*)?.*/\1/' | xargs -n 1 sh -c '[ "$#" -gt 0 ] && printf "%s" "-v $(printenv $1):$(printenv $1) "' _)"
echo "${envs}" "${volumemounts}"
)
}
docker run $(summon_envvars_docker_opts) ...
If the above is ./script.sh , then simply summon ./script.sh
Is your feature request related to a problem? Please describe
Though @SUMMONENVFILE has been useful until now it has some shortcomings
A better approach would be something like @SUMMONDOCKEROPTS , whose usage would look like this
summon docker run @SUMMONDOCKEROPTS myorg/myimage
It would
2. Add -v FILE_PATH:FILE_PATH for all the secrets that are managed as files by summon3. The benefit of (2) is that summon is still managing these files so if it dies then those files are gone.Describe the solution you would like
See above^
Describe alternatives you have considered
Additional context
Add any other context information about the feature request here.
The text was updated successfully, but these errors were encountered: