Skip to content

Commit 8b518bf

Browse files
committedSep 20, 2013
Switch to using nameservers closer to build servers
This causes closer S3 hosts to be used
1 parent d6ec7ca commit 8b518bf

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed
 

‎.travis.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,13 @@ env:
1818
# - S3_CREDENTIALS=
1919
- secure: pZ7DtkEu2q/pGINfVT9S+iPRE5ck6mBQmuHTQz3PVXF/UJmpM1LCbC7aqrw4GXWuUhYc50QCnMZJL1yoBORVEfY4nfXHLRc3HMoWE6Srqf0IBDywi6T+UUdLeOYe13EDb4p8WIpnRGlV4WI1WaPXuFlMEdj5tAjlC9ZotLxyVaI=
2020

21-
# These need to be here and not in the env hash because they need to be
22-
# evaluated after the virtualenv has been setup
2321
before_install:
22+
# Use closer nameservers
23+
- printf "nameserver 199.91.168.70\nnameserver 199.91.168.71\n" | sudo tee /etc/resolv.conf
24+
25+
# These need to be here and not in the env hash because they need to be
26+
# evaluated after the virtualenv has been setup
27+
- mkdir -p $PIP_DOWNLOAD_CACHE
2428
- export WAD_ENVIRONMENT_VARIABLES="TRAVIS_PYTHON_VERSION,TRAVIS_NODE_VERSION,WAD_CACHE_PATH"
2529
- export WAD_CACHE_PATH="node_modules,$PIP_DOWNLOAD_CACHE,$VIRTUAL_ENV"
2630

‎script/wad

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env ruby
22

3-
# Generated on: 15-09-2013 at 01:09
3+
# Generated on: 20-09-2013 at 12:38
44

55
require 'time'
66
require 'net/http'
@@ -10,7 +10,7 @@ require 'digest/sha1'
1010
require 'fileutils'
1111
require 'openssl'
1212
require 'base64'
13-
13+
require 'cgi'
1414
class Presss
1515
# Computes the Authorization header for a AWS request based on a message,
1616
# the access key ID and secret access key.
@@ -102,13 +102,13 @@ class Presss
102102
canonical_path = canonicalized_resource(path)
103103
signature = [ verb.to_s.upcase, nil, nil, expires, [ headers, canonical_path ].flatten.compact ].flatten.join("\n")
104104
signed = authorization.sign(signature)
105-
"#{url_prefix}#{path}?Signature=#{signed}&Expires=#{expires}&AWSAccessKeyId=#{authorization.access_key_id}"
105+
"#{url_prefix}#{path}?Signature=#{CGI.escape(signed)}&Expires=#{expires}&AWSAccessKeyId=#{CGI.escape(authorization.access_key_id)}"
106106
end
107107

108108
def download(path, destination)
109109
url = signed_url(:get, Time.now.to_i + 600, nil, path)
110110
Presss.log "signed_url=#{url}"
111-
system 'curl', '-f', '-o', destination, url
111+
system 'curl', '-f', '-S', '-o', destination, url
112112
$?.success?
113113
end
114114

@@ -118,7 +118,7 @@ class Presss
118118
header = 'x-amz-storage-class:REDUCED_REDUNDANCY'
119119
url = signed_url(:put, Time.now.to_i + 600, header, path)
120120
Presss.log "signed_url=#{url}"
121-
system 'curl', '-f', '-H', header, '-T', file, url
121+
system 'curl', '-f', '-S', '-H', header, '-T', file, url
122122
$?.success?
123123
end
124124
end

0 commit comments

Comments
 (0)
Please sign in to comment.