Skip to content
This repository has been archived by the owner on Jul 11, 2020. It is now read-only.

Commit

Permalink
add Fastly secrets
Browse files Browse the repository at this point in the history
dwradcliffe committed Aug 3, 2015
1 parent 0df840d commit bf97b0b
Showing 4 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Berksfile.lock
Original file line number Diff line number Diff line change
@@ -219,7 +219,7 @@ GRAPH
rubygems-sensu (>= 0.0.0)
rubygems-ssh (>= 0.0.0)
rubygems-utility (>= 0.0.0)
rubygems-app (0.0.54)
rubygems-app (0.0.56)
apt (>= 0.0.0)
chef-vault (>= 0.0.0)
datadog (>= 0.0.0)
2 changes: 1 addition & 1 deletion cookbooks/rubygems-app/metadata.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name 'rubygems-app'

version '0.0.54'
version '0.0.56'

depends 'apt'
depends 'chef-vault'
5 changes: 5 additions & 0 deletions cookbooks/rubygems-app/recipes/config.rb
Original file line number Diff line number Diff line change
@@ -25,6 +25,8 @@
)
end

fastly_domain = node.chef_environment == 'production' ? 'rubygems' : 'rubygems-staging'

template '/applications/rubygems/shared/config/secret.rb' do
source 'secret.rb.erb'
owner 'deploy'
@@ -39,6 +41,9 @@
bundler_api_url: secrets['bundler_api_url'],
new_relic_license_key: secrets['new_relic_license_key'],
new_relic_app_name: "RubyGems.org (#{node.chef_environment})",
fastly_api_key: secrets['fastly_api_key'],
fastly_service_id: secrets['fastly_service_id'],
fastly_domain: "#{fastly_domain}.global.ssl.fastly.net",
honeybadger_api_key: secrets['honeybadger_api_key']
)
end
3 changes: 3 additions & 0 deletions cookbooks/rubygems-app/templates/default/secret.rb.erb
Original file line number Diff line number Diff line change
@@ -6,3 +6,6 @@ ENV['BUNDLER_API_URL'] = "<%= @bundler_api_url %>"
ENV['NEW_RELIC_LICENSE_KEY'] = "<%= @new_relic_license_key %>"
ENV['NEW_RELIC_APP_NAME'] = "<%= @new_relic_app_name %>"
ENV['HONEYBADGER_API_KEY'] = "<%= @honeybadger_api_key %>"
ENV['FASTLY_API_KEY'] = "<%= @fastly_api_key %>"
ENV['FASTLY_SERVICE_ID'] = "<%= @fastly_service_id %>"
ENV['FASTLY_DOMAIN'] = "<%= @fastly_domain %>"

0 comments on commit bf97b0b

Please sign in to comment.