Skip to content

Instantly share code, notes, and snippets.

@devigned
Created May 11, 2017 00:30
Show Gist options
  • Save devigned/788883c3de4a57429bde05171ddf646a to your computer and use it in GitHub Desktop.
Save devigned/788883c3de4a57429bde05171ddf646a to your computer and use it in GitHub Desktop.
Level 1 Secrets.yml
development:
secret_key_base: 39beccc6c842da3ba78f001a09dcb383bc45f927438f668392fc1ba354cd8ef487951c8ca9d6e70eab72af847ff831c3ae62888eae7a2b9c56cb5c202ea59ff1
test:
secret_key_base: 80f167c6678b032aca5c77a6feababbf9b9bbc46820bcd574053385f7e40c0f181dc55547b4b10bbc02df74fb7f64908ef8cfd238f5f35831ae0685dfce216e1
# Do not keep production secrets in the repository,
# instead read values from the environment.
production:
<% if Rails.env.production? # to save time, only run this when in production mode %>
<% vault_name=`az keyvault list --query "[?starts_with(name, 'level1') && resourceGroup == 'level1'] | [0].name" -o tsv`.strip %>
secret_key_base: <%= `az keyvault secret show --vault-name '#{vault_name}' --name 'level1-secret-key-base' --query 'value' -o tsv`.strip %>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment