質問編集履歴
3
デバックを追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -307,3 +307,11 @@
|
|
307
307
|
|
308
308
|
|
309
309
|
設定しているKEYではcapistranoでのデプロイ、ssh接続共にできるのを確認しているのでKEY自体が間違っている事はないと思うのですが、ぜひ詳しい方いらっしゃいましたら教えてください!
|
310
|
+
|
311
|
+
|
312
|
+
|
313
|
+
## 追記
|
314
|
+
|
315
|
+
Circleciのデバック方法を調べCi上に ssh -p でssh接続をするという方法から、
|
316
|
+
|
317
|
+
Ci上で ssh -i ~/.ssh/key.pem user@ipでサーバーに接続を試みましたが、No such file or directory.となりました。
|
2
エラーの内容を変更
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
CircleCi
|
1
|
+
CircleCi ssh接続エラー Net::SSH::ConnectionTimeout (SSHKit::Runner::ExecuteError)
|
test
CHANGED
@@ -22,9 +22,107 @@
|
|
22
22
|
|
23
23
|
```
|
24
24
|
|
25
|
-
|
26
|
-
|
27
|
-
|
25
|
+
|
26
|
+
|
27
|
+
/home/circleci/project/vendor/bundle/ruby/2.5.0/gems/sshkit-1.20.0/lib/sshkit/runners/parallel.rb:15:in `rescue in block (2 levels) in execute': Exception while executing as *********@ip: Net::SSH::ConnectionTimeout (SSHKit::Runner::ExecuteError)
|
28
|
+
|
29
|
+
cap aborted!
|
30
|
+
|
31
|
+
SSHKit::Runner::ExecuteError: Exception while executing as *********@ip: Net::SSH::ConnectionTimeout
|
32
|
+
|
33
|
+
/home/circleci/project/vendor/bundle/ruby/2.5.0/gems/sshkit-1.20.0/lib/sshkit/runners/parallel.rb:15:in `rescue in block (2 levels) in execute'
|
34
|
+
|
35
|
+
/home/circleci/project/vendor/bundle/ruby/2.5.0/gems/sshkit-1.20.0/lib/sshkit/runners/parallel.rb:11:in `block (2 levels) in execute'
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
Caused by:
|
40
|
+
|
41
|
+
Net::SSH::ConnectionTimeout: Net::SSH::ConnectionTimeout
|
42
|
+
|
43
|
+
/home/circleci/project/vendor/bundle/ruby/2.5.0/gems/net-ssh-5.2.0/lib/net/ssh/transport/session.rb:92:in `rescue in initialize'
|
44
|
+
|
45
|
+
/home/circleci/project/vendor/bundle/ruby/2.5.0/gems/net-ssh-5.2.0/lib/net/ssh/transport/session.rb:59:in `initialize'
|
46
|
+
|
47
|
+
/home/circleci/project/vendor/bundle/ruby/2.5.0/gems/net-ssh-5.2.0/lib/net/ssh.rb:246:in `new'
|
48
|
+
|
49
|
+
/home/circleci/project/vendor/bundle/ruby/2.5.0/gems/net-ssh-5.2.0/lib/net/ssh.rb:246:in `start'
|
50
|
+
|
51
|
+
/home/circleci/project/vendor/bundle/ruby/2.5.0/gems/sshkit-1.20.0/lib/sshkit/backends/connection_pool.rb:63:in `call'
|
52
|
+
|
53
|
+
/home/circleci/project/vendor/bundle/ruby/2.5.0/gems/sshkit-1.20.0/lib/sshkit/backends/connection_pool.rb:63:in `with'
|
54
|
+
|
55
|
+
/home/circleci/project/vendor/bundle/ruby/2.5.0/gems/sshkit-1.20.0/lib/sshkit/backends/netssh.rb:177:in `with_ssh'
|
56
|
+
|
57
|
+
/home/circleci/project/vendor/bundle/ruby/2.5.0/gems/sshkit-1.20.0/lib/sshkit/backends/netssh.rb:130:in `execute_command'
|
58
|
+
|
59
|
+
/home/circleci/project/vendor/bundle/ruby/2.5.0/gems/sshkit-1.20.0/lib/sshkit/backends/abstract.rb:148:in `block in create_command_and_execute'
|
60
|
+
|
61
|
+
/home/circleci/project/vendor/bundle/ruby/2.5.0/gems/sshkit-1.20.0/lib/sshkit/backends/abstract.rb:148:in `tap'
|
62
|
+
|
63
|
+
/home/circleci/project/vendor/bundle/ruby/2.5.0/gems/sshkit-1.20.0/lib/sshkit/backends/abstract.rb:148:in `create_command_and_execute'
|
64
|
+
|
65
|
+
/home/circleci/project/vendor/bundle/ruby/2.5.0/gems/sshkit-1.20.0/lib/sshkit/backends/abstract.rb:61:in `test'
|
66
|
+
|
67
|
+
/home/circleci/project/vendor/bundle/ruby/2.5.0/gems/capistrano-rbenv-2.1.6/lib/capistrano/tasks/rbenv.rake:10:in `block (3 levels) in <top (required)>'
|
68
|
+
|
69
|
+
/home/circleci/project/vendor/bundle/ruby/2.5.0/gems/sshkit-1.20.0/lib/sshkit/backends/abstract.rb:31:in `instance_exec'
|
70
|
+
|
71
|
+
/home/circleci/project/vendor/bundle/ruby/2.5.0/gems/sshkit-1.20.0/lib/sshkit/backends/abstract.rb:31:in `run'
|
72
|
+
|
73
|
+
/home/circleci/project/vendor/bundle/ruby/2.5.0/gems/sshkit-1.20.0/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute'
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
Caused by:
|
78
|
+
|
79
|
+
Errno::ETIMEDOUT: Connection timed out - connect(2) for ip
|
80
|
+
|
81
|
+
/usr/local/lib/ruby/2.5.0/socket.rb:64:in `connect'
|
82
|
+
|
83
|
+
/usr/local/lib/ruby/2.5.0/socket.rb:64:in `connect_internal'
|
84
|
+
|
85
|
+
/usr/local/lib/ruby/2.5.0/socket.rb:137:in `connect'
|
86
|
+
|
87
|
+
/usr/local/lib/ruby/2.5.0/socket.rb:641:in `block in tcp'
|
88
|
+
|
89
|
+
/usr/local/lib/ruby/2.5.0/socket.rb:227:in `each'
|
90
|
+
|
91
|
+
/usr/local/lib/ruby/2.5.0/socket.rb:227:in `foreach'
|
92
|
+
|
93
|
+
/usr/local/lib/ruby/2.5.0/socket.rb:631:in `tcp'
|
94
|
+
|
95
|
+
/home/circleci/project/vendor/bundle/ruby/2.5.0/gems/net-ssh-5.2.0/lib/net/ssh/transport/session.rb:73:in `initialize'
|
96
|
+
|
97
|
+
/home/circleci/project/vendor/bundle/ruby/2.5.0/gems/net-ssh-5.2.0/lib/net/ssh.rb:246:in `new'
|
98
|
+
|
99
|
+
/home/circleci/project/vendor/bundle/ruby/2.5.0/gems/net-ssh-5.2.0/lib/net/ssh.rb:246:in `start'
|
100
|
+
|
101
|
+
/home/circleci/project/vendor/bundle/ruby/2.5.0/gems/sshkit-1.20.0/lib/sshkit/backends/connection_pool.rb:63:in `call'
|
102
|
+
|
103
|
+
/home/circleci/project/vendor/bundle/ruby/2.5.0/gems/sshkit-1.20.0/lib/sshkit/backends/connection_pool.rb:63:in `with'
|
104
|
+
|
105
|
+
/home/circleci/project/vendor/bundle/ruby/2.5.0/gems/sshkit-1.20.0/lib/sshkit/backends/netssh.rb:177:in `with_ssh'
|
106
|
+
|
107
|
+
/home/circleci/project/vendor/bundle/ruby/2.5.0/gems/sshkit-1.20.0/lib/sshkit/backends/netssh.rb:130:in `execute_command'
|
108
|
+
|
109
|
+
/home/circleci/project/vendor/bundle/ruby/2.5.0/gems/sshkit-1.20.0/lib/sshkit/backends/abstract.rb:148:in `block in create_command_and_execute'
|
110
|
+
|
111
|
+
/home/circleci/project/vendor/bundle/ruby/2.5.0/gems/sshkit-1.20.0/lib/sshkit/backends/abstract.rb:148:in `tap'
|
112
|
+
|
113
|
+
/home/circleci/project/vendor/bundle/ruby/2.5.0/gems/sshkit-1.20.0/lib/sshkit/backends/abstract.rb:148:in `create_command_and_execute'
|
114
|
+
|
115
|
+
/home/circleci/project/vendor/bundle/ruby/2.5.0/gems/sshkit-1.20.0/lib/sshkit/backends/abstract.rb:61:in `test'
|
116
|
+
|
117
|
+
/home/circleci/project/vendor/bundle/ruby/2.5.0/gems/capistrano-rbenv-2.1.6/lib/capistrano/tasks/rbenv.rake:10:in `block (3 levels) in <top (required)>'
|
118
|
+
|
119
|
+
/home/circleci/project/vendor/bundle/ruby/2.5.0/gems/sshkit-1.20.0/lib/sshkit/backends/abstract.rb:31:in `instance_exec'
|
120
|
+
|
121
|
+
/home/circleci/project/vendor/bundle/ruby/2.5.0/gems/sshkit-1.20.0/lib/sshkit/backends/abstract.rb:31:in `run'
|
122
|
+
|
123
|
+
/home/circleci/project/vendor/bundle/ruby/2.5.0/gems/sshkit-1.20.0/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute'
|
124
|
+
|
125
|
+
Tasks: TOP => rbenv:validate
|
28
126
|
|
29
127
|
```
|
30
128
|
|
1
ソースコードを追加しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -48,11 +48,161 @@
|
|
48
48
|
|
49
49
|
```config.yml
|
50
50
|
|
51
|
+
version: 2 # use CircleCI 2.0
|
52
|
+
|
53
|
+
jobs: # a collection of steps
|
54
|
+
|
55
|
+
build: # runs not using Workflows must have a `build` job as entry point
|
56
|
+
|
57
|
+
parallelism: 3 # run three instances of this job in parallel
|
58
|
+
|
59
|
+
docker: # run the steps with Docker
|
60
|
+
|
61
|
+
- image: circleci/ruby:2.5.1-node-browsers # ...with this image as the primary container; this is where all `steps` will run
|
62
|
+
|
63
|
+
environment: # environment variables for primary container
|
64
|
+
|
65
|
+
BUNDLE_JOBS: 3
|
66
|
+
|
67
|
+
BUNDLE_RETRY: 3
|
68
|
+
|
69
|
+
BUNDLE_PATH: vendor/bundle
|
70
|
+
|
71
|
+
RAILS_ENV: test
|
72
|
+
|
73
|
+
- image: circleci/mysql:5.6
|
74
|
+
|
75
|
+
environment:
|
76
|
+
|
77
|
+
MYSQL_ALLOW_EMPTY_PASSWORD: true
|
78
|
+
|
79
|
+
MYSQL_ROOT_PASSWORD: ''
|
80
|
+
|
81
|
+
MYSQL_DATABASE: app_test
|
82
|
+
|
83
|
+
MYSQL_HOST: 127.0.0.1
|
84
|
+
|
85
|
+
MYSQL_ROOT_HOST: '%'
|
86
|
+
|
87
|
+
MYSQL_USER: root
|
88
|
+
|
89
|
+
steps: # a collection of executable commands
|
90
|
+
|
91
|
+
- checkout # special step to check out source code to working directory
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
# Which version of bundler?
|
96
|
+
|
97
|
+
- run:
|
98
|
+
|
99
|
+
name: Which bundler?
|
100
|
+
|
101
|
+
command: bundle -v
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
# Restore bundle cache
|
106
|
+
|
107
|
+
# Read about caching dependencies: https://circleci.com/docs/2.0/caching/
|
108
|
+
|
109
|
+
- restore_cache:
|
110
|
+
|
111
|
+
keys:
|
112
|
+
|
113
|
+
- rails-demo-bundle-v2-{{ checksum "Gemfile.lock" }}
|
114
|
+
|
115
|
+
- rails-demo-bundle-v2-
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
- run: # Install Ruby dependencies
|
120
|
+
|
121
|
+
name: Bundle Install
|
122
|
+
|
123
|
+
command: bundle check --path vendor/bundle || bundle install --deployment
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
# Store bundle cache for Ruby dependencies
|
128
|
+
|
129
|
+
- save_cache:
|
130
|
+
|
131
|
+
key: rails-demo-bundle-v2-{{ checksum "Gemfile.lock" }}
|
132
|
+
|
133
|
+
paths:
|
134
|
+
|
135
|
+
- vendor/bundle
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
- run:
|
140
|
+
|
141
|
+
name: Yarn Install
|
142
|
+
|
143
|
+
command: yarn install --cache-folder ~/.cache/yarn
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
# Store yarn / webpacker cache
|
148
|
+
|
149
|
+
- save_cache:
|
150
|
+
|
151
|
+
key: rails-demo-yarn-{{ checksum "yarn.lock" }}
|
152
|
+
|
153
|
+
paths:
|
154
|
+
|
155
|
+
- ~/.cache/yarn
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
- run:
|
160
|
+
|
161
|
+
name: Wait for DB
|
162
|
+
|
163
|
+
command: dockerize -wait tcp://127.0.0.1:3306 -timeout 120s
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
- run: bundle exec rake db:create
|
168
|
+
|
169
|
+
- run: bundle exec rake db:schema:load
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
- run:
|
174
|
+
|
175
|
+
name: Run rspec in parallel
|
176
|
+
|
177
|
+
command: |
|
178
|
+
|
179
|
+
bundle exec rspec --profile 10 \
|
180
|
+
|
181
|
+
--format RspecJunitFormatter \
|
182
|
+
|
183
|
+
--out test_results/rspec.xml \
|
184
|
+
|
185
|
+
--format progress \
|
186
|
+
|
187
|
+
$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
# Save test results for timing analysis
|
192
|
+
|
193
|
+
- store_test_results: # Upload test results for display in Test Summary: https://circleci.com/docs/2.0/collect-test-data/
|
194
|
+
|
195
|
+
path: test_results
|
196
|
+
|
197
|
+
# See https://circleci.com/docs/2.0/deployment-integrations/ for example deploy configs
|
198
|
+
|
199
|
+
|
200
|
+
|
51
201
|
- add_ssh_keys:
|
52
202
|
|
53
203
|
fingerprints:
|
54
204
|
|
55
|
-
- "41xxxxxxx"
|
205
|
+
- "41xxxxxxxxxxx"
|
56
206
|
|
57
207
|
```
|
58
208
|
|