質問編集履歴
2
deploy.rb追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -159,3 +159,103 @@
|
|
159
159
|
|
160
160
|
|
161
161
|
```
|
162
|
+
|
163
|
+
deploy.rb
|
164
|
+
|
165
|
+
```
|
166
|
+
|
167
|
+
# config valid for current version and patch releases of Capistrano
|
168
|
+
|
169
|
+
lock "~> 3.16.0"
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
set :application, "sdf_app"
|
174
|
+
|
175
|
+
set :repo_url, "git@github.com:ikkorokoro/sdf-app.git"
|
176
|
+
|
177
|
+
set :rbenv_ruby, File.read('.ruby-version').strip
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
# Nginxの設定ファイル名と置き場所を修正
|
182
|
+
|
183
|
+
set :nginx_config_name, "#{fetch(:application)}.conf"
|
184
|
+
|
185
|
+
set :nginx_sites_enabled_path, "/etc/nginx/conf.d"
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
append :linked_files, "config/master.key"
|
190
|
+
|
191
|
+
append :linked_dirs, "log", "tmp/pids", "tmp/cache", "tmp/sockets", "node_modules"
|
192
|
+
|
193
|
+
# Default branch is :master
|
194
|
+
|
195
|
+
# ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
# Default deploy_to directory is /var/www/my_app_name
|
200
|
+
|
201
|
+
# set :deploy_to, "/var/www/my_app_name"
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
# Default value for :format is :airbrussh.
|
206
|
+
|
207
|
+
# set :format, :airbrussh
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
# You can configure the Airbrussh format using :format_options.
|
212
|
+
|
213
|
+
# These are the defaults.
|
214
|
+
|
215
|
+
# set :format_options, command_output: true, log_file: "log/capistrano.log", color: :auto, truncate: :auto
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
# Default value for :pty is false
|
220
|
+
|
221
|
+
# set :pty, true
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
# Default value for :linked_files is []
|
226
|
+
|
227
|
+
# append :linked_files, "config/database.yml"
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
# Default value for linked_dirs is []
|
232
|
+
|
233
|
+
# append :linked_dirs, "log", "tmp/pids", "tmp/cache", "tmp/sockets", "public/system"
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
# Default value for default_env is {}
|
238
|
+
|
239
|
+
# set :default_env, { path: "/opt/ruby/bin:$PATH" }
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
# Default value for local_user is ENV['USER']
|
244
|
+
|
245
|
+
# set :local_user, -> { `git config user.name`.chomp }
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
# Default value for keep_releases is 5
|
250
|
+
|
251
|
+
# set :keep_releases, 5
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
# Uncomment the following to require manually verifying the host key before first deploy.
|
256
|
+
|
257
|
+
# set :ssh_options, verify_host_key: :secure
|
258
|
+
|
259
|
+
|
260
|
+
|
261
|
+
```
|
1
database.yml .envの追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -59,3 +59,103 @@
|
|
59
59
|
上記のエラー後、サーバー側のmysqlにはログインできることは確認できています。
|
60
60
|
|
61
61
|
上記のエラーが発生したので原因がわかる方がいましたらご教授して頂きでたいです。
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
以下追記させて頂きます。
|
66
|
+
|
67
|
+
database.yml
|
68
|
+
|
69
|
+
```
|
70
|
+
|
71
|
+
default: &default
|
72
|
+
|
73
|
+
adapter: mysql2
|
74
|
+
|
75
|
+
encoding: utf8mb4
|
76
|
+
|
77
|
+
pool: 5
|
78
|
+
|
79
|
+
username: <%= ENV['DB_USER'] %>
|
80
|
+
|
81
|
+
password: <%= ENV['DB_PASSWORD'] %>
|
82
|
+
|
83
|
+
socket: /tmp/mysql.sock
|
84
|
+
|
85
|
+
host: localhost
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
development:
|
90
|
+
|
91
|
+
<<: *default
|
92
|
+
|
93
|
+
database: <%= ENV['DB_NAME'] %>
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
test:
|
98
|
+
|
99
|
+
<<: *default
|
100
|
+
|
101
|
+
database: sdf_app_test
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
production:
|
106
|
+
|
107
|
+
adapter: mysql2
|
108
|
+
|
109
|
+
encoding: utf8mb4
|
110
|
+
|
111
|
+
pool: 5
|
112
|
+
|
113
|
+
database: sdf_app_production
|
114
|
+
|
115
|
+
username: root
|
116
|
+
|
117
|
+
password: <%= ENV['RDS_PASSWORD'] %>
|
118
|
+
|
119
|
+
host: <%= ENV['RDS_ENDPOINT'] %>
|
120
|
+
|
121
|
+
```
|
122
|
+
|
123
|
+
.env(流出するので値のみ削除しています)
|
124
|
+
|
125
|
+
```
|
126
|
+
|
127
|
+
DB_USER =
|
128
|
+
|
129
|
+
DB_PASSWORD =
|
130
|
+
|
131
|
+
DB_NAME =
|
132
|
+
|
133
|
+
LANG =
|
134
|
+
|
135
|
+
RACK_ENV =
|
136
|
+
|
137
|
+
RAILS_ENV =
|
138
|
+
|
139
|
+
RAILS_LOG_TO_STDOUT =
|
140
|
+
|
141
|
+
RAILS_SERVE_STATIC_FILES =
|
142
|
+
|
143
|
+
SDF_APP_DATABASE_PASSWORD =
|
144
|
+
|
145
|
+
DATABASE_URL =
|
146
|
+
|
147
|
+
SECRET_KEY_BASE =
|
148
|
+
|
149
|
+
AWS_ACCESS_KEY =
|
150
|
+
|
151
|
+
AWS_SECRET_KEY =
|
152
|
+
|
153
|
+
AWS_BUCKET_NAME =
|
154
|
+
|
155
|
+
RDS_PASSWORD =
|
156
|
+
|
157
|
+
RDS_ENDPOINT =
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
```
|