Skip to content

Commit

Permalink
Move variables to configuration.yml file
Browse files Browse the repository at this point in the history
  • Loading branch information
ebrett committed Dec 1, 2023
1 parent fd5dd23 commit b490690
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 34 deletions.
1 change: 1 addition & 0 deletions .github/workflows/azure-deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
push:
branches:
- main
- er-signup-url
paths-ignore:
- '**/*.md'
- .docker*
Expand Down
14 changes: 0 additions & 14 deletions app/constraints/cms_route_constraint.rb

This file was deleted.

2 changes: 1 addition & 1 deletion app/views/layouts/_analytics_body.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- Google Tag Manager (noscript) -->
<noscript>
<iframe src="<%= GoogleAnalytics::JS_URL %>" height="0" width="0" style="display:none;visibility:hidden">
<iframe src="<%= Rails.configuration.js_url %>" height="0" width="0" style="display:none;visibility:hidden">
</iframe>
</noscript>
<!-- End Google Tag Manager (noscript) -->
4 changes: 2 additions & 2 deletions app/views/layouts/_analytics_header.html.erb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<!-- Google tag (gtag.js) -->
<script async src=<%= "https://www.googletagmanager.com/gtag/js?id=#{GoogleAnalytics::TRACKING_ID}" %>></script>
<script async src=<%= Rails.configuration.js_url %>></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', '<%= GoogleAnalytics::TRACKING_ID %>');
gtag('config', '<%= Rails.configuration.tracking_id %>');
</script>
12 changes: 5 additions & 7 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
module GovukRailsBoilerplate
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 6.0
config.autoloader = :classic
config.load_defaults 6.1

# Settings in config/environments/* take precedence over those specified here.
# Application configuration can go into files in config/initializers
Expand All @@ -43,13 +42,12 @@ class Application < Rails::Application

config.middleware.use Rack::RejectTrace
config.middleware.use Rack::Deflater
subdomain = ENV.fetch('DOMAIN', "eyfs-dev").split(".").first
allowed_spaces = %w[eyfs-dev eyfs-pre-prod eyfs-prod eyfs-sandbox eyfs-test]
config.space = allowed_spaces.include?(subdomain) ? subdomain : "eyfs-dev"

config.i18n.load_path += Dir[Rails.root.join('config', 'locales', 'content', '*.{rb,yml}').to_s]

config.feedback_url = ENV.fetch('FEEDBACK_URL', '#FEEDBACK_URL_env_var_missing')
config.signup_url = ENV.fetch('SIGNUP_URL', '#SIGNUP_env_var_missing')
config.feedback_url = ENV.fetch('FEEDBACK_URL', config_for(:configuration)['feedback_url'] || '#FEEDBACK_env_var_missing')
config.signup_url = ENV.fetch('SIGNUP_URL', config_for(:configuration)['signup_url'] || '#SIGNUP_env_var_missing')
config.tracking_id = ENV.fetch('TRACKING_ID', config_for(:configuration)['tracking_id'] || '#TRACKING_ID_env_var_missing')
config.js_url = "https://www.googletagmanager.com/ns.html?id=#{config.tracking_id}"
end
end
7 changes: 7 additions & 0 deletions config/configuration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
shared:
tracking_id: G-2YJFCCJ520
feedback_url: https://forms.office.com/Pages/ResponsePage.aspx?id=yXfS-grGoU2187O4s0qC-a1INvUBHVZElO6Xg1Rw2V9UM1pQNEtCN0YyVVdFVkpOUVNXNUlZNTdOUCQlQCN0PWcu
signup_url: https://forms.office.com.mcas.ms/Pages/ResponsePage.aspx?id=yXfS-grGoU2187O4s0qC-a1INvUBHVZElO6Xg1Rw2V9UQlg3SlFPTVZIRlFaVDY5MzJQQUxQTk0yQyQlQCN0PWcu

production:
tracking_id: G-WRRWDTSGBP
1 change: 0 additions & 1 deletion config/credentials/deployed_development.yml.enc

This file was deleted.

2 changes: 1 addition & 1 deletion config/credentials/development.yml.enc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
BVeMLef6JCIIqlPUpzcJ3d1UlPOXLGiRXaPEIvSlhQf8UlyCYYnf3LXBGC4jXlxgH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8Ii9s3MilHONBiBy8qAFNaep/2hqhCn0swmaC/wBLf+79xwtbp3kYfEE6C3PPc6TY/txndc51b1uNd0sNmEN40X+GS33jWH8KjaJm5+xVkt5BL0FcgKc+ANOv7ohGXJKi42En2Ug+G+nRhYQQToirjXYE+1KtEZDUC8ER4/X3wf0xbETzQsVhR2EaEGQ30/JrjZXoL4T1lbcr7wro7TFVtAmG0q6M0LpMBhWKDATXyOYVfFOWn3Vfi2Z1+H1BK+XYxJ+nzaNje0xTs30SRXpftO+rnbHWdHTSpLHxBF89vtznmZU34zqYFnJg0YmXf+2WPOL9/5YDMl/niOLc6WVArPm4/sJ7wBcWDj21mFcgpMXupQ/7RI+TnphbyNoXypZIjCfUuK3xtNKTZWMpMYGxXy3NH/ROqd/U0S1pC6W5M/vaJNEVY0qd60nBRyWRccu8+IJs0xulGYp3Nn6kQLLXByxhHzyLBojfyQv2gRbLBuhjIabGmOOY/5ZsDrtSPoxrkzCVUKsne7lC4G+eoj2DF2S3DPj2ZdVzeBnY8VGLfXYUU0DX4AKg+D2cV+RR/1nfIN2e8vGwBMzMpxJdUzw/oRg1h8Cxdt2qa8HA/J4=--1z6I1nltBZHkciFk--Y+MsuSztkBDgaR+/hCqthQ==
1 change: 0 additions & 1 deletion config/credentials/sandbox.yml.enc

This file was deleted.

1 change: 0 additions & 1 deletion config/credentials/staging.yml.enc

This file was deleted.

6 changes: 0 additions & 6 deletions config/initializers/google_analytics.rb

This file was deleted.

0 comments on commit b490690

Please sign in to comment.