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

Deploy #2 9/20/2016 #1267

Merged
merged 4 commits into from
Sep 20, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions app/credentials/secrets.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
require 'concerns/user_provided_service'

class Secrets
extend UserProvidedService

def self.secret_key_base
if use_env_var?
''
else
credentials('secrets')['secret_key_base']
end
end
end
2 changes: 1 addition & 1 deletion app/services/tock_importer.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class TockImporter
TOCK_PROJECTS = "https://tock-app.18f.gov/api/projects.json".freeze
TOCK_PROJECTS = "https://tock.18f.gov/api/projects.json".freeze

def perform
projects.each do |project|
Expand Down
19 changes: 1 addition & 18 deletions config/secrets.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,8 @@
# Be sure to restart your server when you modify this file.

# Your secret key is used for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!

# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
# You can use `rake secret` to generate a secure secret key.

# Make sure the secrets in this file are kept private
# if you're sharing your code publicly.

development:
secret_key_base: 787f9378e8d9e0eac392f57c7a9927daf12c410e8a882b7bedbb4126748db4d6230893a104cb12d2bf09af76d1fb1939eeb072a97709999d062f38e965c4d1cd

test:
secret_key_base: 8607c91c228d6414a72e6b0da24abd6f43ba21395ec05ffbf174e78afc7792cf294ff00f44c35f10f078bd374b04c99c499a89e4997750d83df452e9c76b5f7a

# Do not keep production secrets in the repository,
# instead read values from the environment.
staging:
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>

production:
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
secret_key_base: <%= Secrets.secret_key_base %>
1 change: 1 addition & 0 deletions manifest-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ applications:
- micropurchase-staging-psql
- micropurchase-smtp
- new-relic
- secrets
command: script/start
env:
RAILS_ENV: production
Expand Down
1 change: 1 addition & 0 deletions manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ applications:
- micropurchase-psql
- micropurchase-smtp
- new-relic
- secrets
command: script/start
env:
RAILS_ENV: production
Expand Down
2 changes: 1 addition & 1 deletion spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
config.before do
mock_github
WebMock.stub_request(:any, /api.data.gov/).to_rack(FakeSamApi)
WebMock.stub_request(:any, /tock-app.18f.gov/).to_rack(FakeTockApi)
WebMock.stub_request(:any, /tock.18f.gov/).to_rack(FakeTockApi)
WebMock.stub_request(:any, /cap.18f.gov/).to_rack(FakeC2Api)
WebMock.stub_request(:any, /c2-dev.18f.gov/).to_rack(FakeC2Api)
WebMock.stub_request(:any, /api.github.com/).to_rack(FakeGitHubApi)
Expand Down