File tree Expand file tree Collapse file tree 2 files changed +16
-6
lines changed Expand file tree Collapse file tree 2 files changed +16
-6
lines changed Original file line number Diff line number Diff line change 7
7
- RAILS_VERSION="~> 3.2.0"
8
8
- RAILS_VERSION="~> 4.0.0"
9
9
- RAILS_VERSION="~> 4.1.0.rc1"
10
+ before_script :
11
+ - travis_retry gem install rails --version "$RAILS_VERSION"
Original file line number Diff line number Diff line change @@ -220,17 +220,25 @@ def await_reload
220
220
end
221
221
end
222
222
223
- def run! ( *args )
224
- artifacts = run ( *args )
225
- unless artifacts [ :status ] . success?
223
+ def run! ( command , options = { } )
224
+ attempts = ( options . delete ( :retry ) || 0 ) + 1
225
+ artifacts = nil
226
+
227
+ until attempts == 0 || artifacts && artifacts [ :status ] . success?
228
+ artifacts = run ( command , options )
229
+ attempts -= 1
230
+ end
231
+
232
+ if artifacts [ :status ] . success?
233
+ artifacts
234
+ else
226
235
raise "command failed\n \n #{ debug ( artifacts ) } "
227
236
end
228
- artifacts
229
237
end
230
238
231
239
def bundle
232
- run! "(gem list bundler | grep bundler) || gem install bundler" , timeout : nil
233
- run! "bundle update" , timeout : nil
240
+ run! "(gem list bundler | grep bundler) || gem install bundler" , timeout : nil , retry : 2
241
+ run! "bundle update --retry=2 " , timeout : nil
234
242
end
235
243
236
244
private
You can’t perform that action at this time.
0 commit comments