@@ -450,65 +450,6 @@ task :authors do
450
450
sh "(git log --use-mailmap --format='%aN <%aE>' ; cat .OLD_AUTHORS) | sort -uf > AUTHORS"
451
451
end
452
452
453
- namespace :ci do
454
- task :upload_to_sauce do
455
- upload_path = ENV [ 'UPLOAD_PATH' ]
456
- username = ENV [ 'SAUCE_USERNAME' ]
457
- apikey = ENV [ 'SAUCE_APIKEY' ]
458
- upload_filename = Pathname . new ( upload_path ) . basename
459
- upload_url = "http://saucelabs.com/rest/v1/storage/#{ username } /#{ upload_filename } "
460
- body = nil
461
-
462
- File . open ( find_file ( upload_path ) , 'r' ) do |infile |
463
- body = infile . read
464
- end
465
-
466
- 6 . times do
467
- uri = URI . parse ( upload_url )
468
- request = Net ::HTTP ::Post . new ( uri . request_uri )
469
- request . basic_auth ( username , apikey )
470
- request [ 'Content-Type' ] = 'application/octet-stream'
471
- request . body = body
472
- http = net_http . new ( uri . host , uri . port )
473
- http . read_timeout = 60 * 5 # 5 min
474
- begin
475
- response = http . request ( request )
476
- rescue StandardError => e
477
- puts "issue uploading file: #{ e } "
478
- next
479
- end
480
- metadata = JSON . parse ( response . body )
481
- local_digest = Digest ::MD5 . hexdigest ( body )
482
- if metadata [ 'md5' ] == local_digest
483
- puts "file successfully uploaded: #{ metadata [ 'filename' ] } "
484
- else
485
- puts "issues uploading file: #{ response . code } - #{ response . body } "
486
- end
487
- break
488
- end
489
- raise 'failed to upload to saucelabs after numerous retries'
490
- end
491
- end
492
-
493
- # Required for above ci:upload_to_sauce rake only
494
- require 'uri'
495
- require 'net/http'
496
- require 'digest/md5'
497
- require 'json'
498
- require 'pathname'
499
-
500
- def net_http
501
- http_proxy = ENV [ 'http_proxy' ] || ENV [ 'HTTP_PROXY' ]
502
- if http_proxy
503
- http_proxy = "http://#{ http_proxy } " unless http_proxy . start_with? ( 'http://' )
504
- proxy_uri = URI . parse ( http_proxy )
505
-
506
- Net ::HTTP ::Proxy ( proxy_uri . host , proxy_uri . port )
507
- else
508
- Net ::HTTP
509
- end
510
- end
511
-
512
453
at_exit do
513
454
if File . exist? ( ".git" ) && !SeleniumRake ::Checks . windows?
514
455
system "sh" , ".git-fixfiles"
0 commit comments