Skip to content

Instantly share code, notes, and snippets.

@mrunkel
Created March 3, 2021 08:52
Show Gist options
  • Save mrunkel/39d08321a03a0265cc355302f3a146ba to your computer and use it in GitHub Desktop.
Save mrunkel/39d08321a03a0265cc355302f3a146ba to your computer and use it in GitHub Desktop.
A little script to move variables from your symfony .env files to secrets quickly and easily.
#!/bin/zsh
typeset -a names
names=(DATABASE_URL RUBYOA_DB_URL PHPOA_DB_URL\
MAILER_DSN APP_SECRET APP_DEBUG SHELL_VERBOSITY\
PIWIK_ID PIWIK_SECRET PIWIK_URL\
AMS_SERVER AMS_USER AMS_PORT AMS_PATH\
)
env=$1
if [ -z "$env" ]; then
env='localdev'
fi
for name in "$names[@]" ; do
echo $name
echo '' | ./bin/console secrets:set $name -e$env -
done
./bin/console secrets:encrypt-from-local -e$env
./bin/console secrets:list -e$env --reveal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment