File tree Expand file tree Collapse file tree 3 files changed +58
-2
lines changed Expand file tree Collapse file tree 3 files changed +58
-2
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,49 @@ def setup_staging_environment
51
51
run 'cp config/environments/production.rb config/environments/staging.rb'
52
52
end
53
53
54
+ def generate_config
55
+ generate 'config:install'
56
+ run 'cp config/settings/development.yml config/settings/staging.yml'
57
+ end
58
+
59
+ def fill_settings_yml
60
+ config = <<-YML
61
+ email:
62
+ sandbox: sandbox@#{ app_name } .com
63
+ noreply: no-reply@#{ app_name } .com
64
+ admin: admin@#{ app_name } .com
65
+
66
+ basic_auth:
67
+ username: #{ app_name }
68
+ password: #{ app_name }
69
+
70
+ sidekiq:
71
+ username: #{ app_name }
72
+ password: #{ app_name }
73
+
74
+ root_path: <%= ENV['ROOT_PATH'] %>
75
+
76
+ smtp:
77
+ address: <%= ENV['SMTP_ADDRESS'] %>
78
+ port: 587
79
+ enable_starttls_auto: true
80
+ user_name: <%= ENV['SMTP_USER_NAME'] %>
81
+ password: <%= ENV['SMTP_PASSWORD'] %>
82
+ authentication: 'plain'
83
+
84
+ AWS:
85
+ S3:
86
+ bucket: <%= ENV['S3_BUCKET_NAME'] %>
87
+ access_key_id: <%= ENV['AWS_ACCESS_KEY_ID'] %>
88
+ secret_access_key: <%= ENV['AWS_SECRET_ACCESS_KEY'] %>
89
+ aws_url: http://<%= ENV['AWS_RAW_URL'] %>
90
+ aws_raw_url: <%= ENV['AWS_RAW_URL'] %>
91
+ # Bucket region should be ireland for this setting
92
+ end_point: s3-eu-west-1.amazonaws.com
93
+ YML
94
+ prepend_file 'config/settings.yml' , config
95
+ end
96
+
54
97
private
55
98
56
99
def configure_environment ( rails_env , config )
Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ def setup_responders
101
101
end
102
102
103
103
def setup_staging_environment
104
- say 'Setting up the staging environment'
104
+ say 'Setting up the staging environment' , :green
105
105
build :setup_staging_environment
106
106
end
107
107
@@ -110,6 +110,16 @@ def configure_recipient_interceptor
110
110
build :configure_recipient_interceptor
111
111
end
112
112
113
+ def setup_config
114
+ say 'Generate config' , :green
115
+ build :generate_config
116
+ end
117
+
118
+ def fill_settings_yml
119
+ say 'Fill to settings.yml file' , :green
120
+ build :fill_settings_yml
121
+ end
122
+
113
123
def goodbye
114
124
say 'Congratulations! That\'s all...' , :green
115
125
end
Original file line number Diff line number Diff line change 1
1
2
2
# For never accidentally send emails to real people from staging environment.
3
- gem 'recipient_interceptor', '~> 0.1.2'
3
+ gem 'recipient_interceptor', '~> 0.1.2'
4
+
5
+ # RailsConfig helps you easily manage environment specific Rails settings in an easy and usable manner
6
+ gem 'config', '~> 1.5'
You can’t perform that action at this time.
0 commit comments