diff options
| author | Vojta Jina | 2013-11-19 16:50:23 -0800 | 
|---|---|---|
| committer | Vojta Jina | 2013-11-25 15:19:28 -0800 | 
| commit | ffd075b44010102e628ce3ade9a54bfde80fdd76 (patch) | |
| tree | 928593912d840e5a88b35d8bfe148f7cf0a7a5fd /lib | |
| parent | 3fcd228441a70bd69090aa6d5c01ad194a4dd10c (diff) | |
| download | angular.js-ffd075b44010102e628ce3ade9a54bfde80fdd76.tar.bz2 | |
chore(travis): let's give BrowserStack a try
Switch the build to use BrowserStack instead of SauceLabs.
This also adds IE11 to our build.
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/browser-stack/start-tunnel.js | 47 | ||||
| -rwxr-xr-x | lib/browser-stack/start-tunnel.sh | 1 | 
2 files changed, 48 insertions, 0 deletions
| diff --git a/lib/browser-stack/start-tunnel.js b/lib/browser-stack/start-tunnel.js new file mode 100644 index 00000000..f2b475d8 --- /dev/null +++ b/lib/browser-stack/start-tunnel.js @@ -0,0 +1,47 @@ +var fs = require('fs'); +var http = require('http'); +var BrowserStackTunnel = require('browserstacktunnel-wrapper'); + +var HOSTNAME = 'localhost'; +var PORTS = [9090, 9876]; +var ACCESS_KEY = process.env.BROWSER_STACK_ACCESS_KEY; +var READY_FILE = process.env.SAUCE_CONNECT_READY_FILE; + +// We need to start fake servers, otherwise the tunnel does not start. +var fakeServers = []; +var hosts = []; + +PORTS.forEach(function(port) { +  fakeServers.push(http.createServer(function() {}).listen(port)); +  hosts.push({ +    name: HOSTNAME, +    port: port, +    sslFlag: 0 +  }); +}); + +var tunnel = new BrowserStackTunnel({ +  key: ACCESS_KEY, +  hosts: hosts +}); + + +tunnel.start(function(error) { +  console.log('** callback **') +  if (error) { +    console.error('Can not establish the tunnel', error); +  } else { +    console.log('Tunnel established.'); +    fakeServers.forEach(function(server) { +      server.close(); +    }); + +    if (READY_FILE) { +      fs.writeFile(READY_FILE, ''); +    } +  } +}); + +tunnel.on('error', function(error) { +  console.error(error); +}); diff --git a/lib/browser-stack/start-tunnel.sh b/lib/browser-stack/start-tunnel.sh new file mode 100755 index 00000000..51ad07fb --- /dev/null +++ b/lib/browser-stack/start-tunnel.sh @@ -0,0 +1 @@ +node ./lib/browser-stack/start-tunnel.js & | 
