Просмотр исходного кода

Switch to using nameservers closer to build servers

This causes closer S3 hosts to be used
Eric Lindvall 11 лет назад
Родитель
Сommit
8b518bf963
2 измененных файлов с 11 добавлено и 7 удалено
  1. 6 2
      .travis.yml
  2. 5 5
      script/wad

+ 6 - 2
.travis.yml

@@ -18,9 +18,13 @@ env:
     # - S3_CREDENTIALS=
     # - S3_CREDENTIALS=
     - secure: pZ7DtkEu2q/pGINfVT9S+iPRE5ck6mBQmuHTQz3PVXF/UJmpM1LCbC7aqrw4GXWuUhYc50QCnMZJL1yoBORVEfY4nfXHLRc3HMoWE6Srqf0IBDywi6T+UUdLeOYe13EDb4p8WIpnRGlV4WI1WaPXuFlMEdj5tAjlC9ZotLxyVaI=
     - secure: pZ7DtkEu2q/pGINfVT9S+iPRE5ck6mBQmuHTQz3PVXF/UJmpM1LCbC7aqrw4GXWuUhYc50QCnMZJL1yoBORVEfY4nfXHLRc3HMoWE6Srqf0IBDywi6T+UUdLeOYe13EDb4p8WIpnRGlV4WI1WaPXuFlMEdj5tAjlC9ZotLxyVaI=
 
 
-# These need to be here and not in the env hash because they need to be
-# evaluated after the virtualenv has been setup
 before_install:
 before_install:
+  # Use closer nameservers
+  - printf "nameserver 199.91.168.70\nnameserver 199.91.168.71\n" | sudo tee /etc/resolv.conf
+
+  # These need to be here and not in the env hash because they need to be
+  # evaluated after the virtualenv has been setup
+  - mkdir -p $PIP_DOWNLOAD_CACHE
   - export WAD_ENVIRONMENT_VARIABLES="TRAVIS_PYTHON_VERSION,TRAVIS_NODE_VERSION,WAD_CACHE_PATH"
   - export WAD_ENVIRONMENT_VARIABLES="TRAVIS_PYTHON_VERSION,TRAVIS_NODE_VERSION,WAD_CACHE_PATH"
   - export WAD_CACHE_PATH="node_modules,$PIP_DOWNLOAD_CACHE,$VIRTUAL_ENV"
   - export WAD_CACHE_PATH="node_modules,$PIP_DOWNLOAD_CACHE,$VIRTUAL_ENV"
 
 

+ 5 - 5
script/wad

@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 #!/usr/bin/env ruby
 
 
-# Generated on: 15-09-2013 at 01:09
+# Generated on: 20-09-2013 at 12:38
 
 
 require 'time'
 require 'time'
 require 'net/http'
 require 'net/http'
@@ -10,7 +10,7 @@ require 'digest/sha1'
 require 'fileutils'
 require 'fileutils'
 require 'openssl'
 require 'openssl'
 require 'base64'
 require 'base64'
-
+require 'cgi'
 class Presss
 class Presss
   # Computes the Authorization header for a AWS request based on a message,
   # Computes the Authorization header for a AWS request based on a message,
   # the access key ID and secret access key.
   # the access key ID and secret access key.
@@ -102,13 +102,13 @@ class Presss
       canonical_path = canonicalized_resource(path)
       canonical_path = canonicalized_resource(path)
       signature      = [ verb.to_s.upcase, nil, nil, expires, [ headers, canonical_path ].flatten.compact ].flatten.join("\n")
       signature      = [ verb.to_s.upcase, nil, nil, expires, [ headers, canonical_path ].flatten.compact ].flatten.join("\n")
       signed         = authorization.sign(signature)
       signed         = authorization.sign(signature)
-      "#{url_prefix}#{path}?Signature=#{signed}&Expires=#{expires}&AWSAccessKeyId=#{authorization.access_key_id}"
+      "#{url_prefix}#{path}?Signature=#{CGI.escape(signed)}&Expires=#{expires}&AWSAccessKeyId=#{CGI.escape(authorization.access_key_id)}"
     end
     end
 
 
     def download(path, destination)
     def download(path, destination)
       url = signed_url(:get, Time.now.to_i + 600, nil, path)
       url = signed_url(:get, Time.now.to_i + 600, nil, path)
       Presss.log "signed_url=#{url}"
       Presss.log "signed_url=#{url}"
-      system 'curl', '-f', '-o', destination, url
+      system 'curl', '-f', '-S', '-o', destination, url
       $?.success?
       $?.success?
     end
     end
 
 
@@ -118,7 +118,7 @@ class Presss
       header = 'x-amz-storage-class:REDUCED_REDUNDANCY'
       header = 'x-amz-storage-class:REDUCED_REDUNDANCY'
       url = signed_url(:put, Time.now.to_i + 600, header, path)
       url = signed_url(:put, Time.now.to_i + 600, header, path)
       Presss.log "signed_url=#{url}"
       Presss.log "signed_url=#{url}"
-      system 'curl', '-f', '-H', header, '-T', file, url
+      system 'curl', '-f', '-S', '-H', header, '-T', file, url
       $?.success?
       $?.success?
     end
     end
   end
   end