diff --git a/config/nightwatch.json b/config/nightwatch.json index b379a80c..1254b587 100644 --- a/config/nightwatch.json +++ b/config/nightwatch.json @@ -1,101 +1,101 @@ { - "src_folders": ["test/browser/tests"], - "output_folder": "./test/browser/reports", - "globals_path": "./node_modules/@financial-times/n-heroku-tools/config/nightwatch-globals.js", - "custom_commands_path": "./node_modules/@financial-times/n-heroku-tools/config/nightwatch-commands", - "test_workers": true, - "test_settings": { - "default": { - "end_session_on_fail": false, - "launch_url": "${TEST_URL}", - "selenium_port": 80, - "selenium_host": "ondemand.saucelabs.com", - "screenshots": { - "enabled": true, - "on_failure" : true, - "path": "./test/browser/screenshots" - }, - "username": "${SAUCE_USER}", - "access_key": "${SAUCE_KEY}", - "desiredCapabilities": { - "browserName": "chrome", - "version": "latest", - "platform": "Windows 10" - } - }, - "chrome": { - "desiredCapabilities": { - "browserName": "chrome", - "version": "latest", - "platform": "Windows 10" - } - }, - "firefox": { - "desiredCapabilities": { - "browserName": "firefox", - "version": "latest", - "platform": "Windows 10" - } - }, - "edge": { - "desiredCapabilities": { - "browserName": "MicrosoftEdge", - "version": "13.10586", - "platform": "Windows 10" - } - }, - "ie11": { - "desiredCapabilities": { - "browserName": "internet explorer", - "version": "11.0", - "platform": "Windows 8.1" - } - }, - "ie10": { - "desiredCapabilities": { - "browserName": "internet explorer", - "version": "10.0", - "platform": "Windows 8" - } - }, - "ie9": { - "desiredCapabilities": { - "browserName": "internet explorer", - "version": "9.0", - "platform": "Windows 7" - } - }, - "ie8": { - "desiredCapabilities": { - "browserName": "internet explorer", - "version": "8.0", - "platform": "Windows 7" - } - }, - "safari": { - "desiredCapabilities": { - "browserName": "safari", - "version": "latest", - "platform": "OS X 10.11" - } - }, - "iphone6_plus": { - "desiredCapabilities": { - "browserName": "Safari", - "deviceName": "iPhone 6 Plus", - "platformVersion": "9.3", - "platformName": "iOS", - "deviceOrientation": "portrait" - } - }, - "Android_Nexus7HD": { - "desiredCapabilities": { - "browserName": "Browser", - "deviceName": "Google Nexus 7 HD Emulator", - "platformVersion": "4.4", - "platformName": "Android", - "deviceOrientation": "portrait" - } - } - } + "src_folders": ["test/browser/tests"], + "output_folder": "./test/browser/reports", + "globals_path": "./node_modules/@financial-times/n-heroku-tools/config/nightwatch-globals.js", + "custom_commands_path": "./node_modules/@financial-times/n-heroku-tools/config/nightwatch-commands", + "test_workers": true, + "test_settings": { + "default": { + "end_session_on_fail": false, + "launch_url": "${TEST_URL}", + "selenium_port": 80, + "selenium_host": "ondemand.saucelabs.com", + "screenshots": { + "enabled": true, + "on_failure" : true, + "path": "./test/browser/screenshots" + }, + "username": "${SAUCE_USER}", + "access_key": "${SAUCE_KEY}", + "desiredCapabilities": { + "browserName": "chrome", + "version": "latest", + "platform": "Windows 10" + } + }, + "chrome": { + "desiredCapabilities": { + "browserName": "chrome", + "version": "latest", + "platform": "Windows 10" + } + }, + "firefox": { + "desiredCapabilities": { + "browserName": "firefox", + "version": "latest", + "platform": "Windows 10" + } + }, + "edge": { + "desiredCapabilities": { + "browserName": "MicrosoftEdge", + "version": "13.10586", + "platform": "Windows 10" + } + }, + "ie11": { + "desiredCapabilities": { + "browserName": "internet explorer", + "version": "11.0", + "platform": "Windows 8.1" + } + }, + "ie10": { + "desiredCapabilities": { + "browserName": "internet explorer", + "version": "10.0", + "platform": "Windows 8" + } + }, + "ie9": { + "desiredCapabilities": { + "browserName": "internet explorer", + "version": "9.0", + "platform": "Windows 7" + } + }, + "ie8": { + "desiredCapabilities": { + "browserName": "internet explorer", + "version": "8.0", + "platform": "Windows 7" + } + }, + "safari": { + "desiredCapabilities": { + "browserName": "safari", + "version": "latest", + "platform": "OS X 10.11" + } + }, + "iphone6_plus": { + "desiredCapabilities": { + "browserName": "Safari", + "deviceName": "iPhone 6 Plus", + "platformVersion": "9.3", + "platformName": "iOS", + "deviceOrientation": "portrait" + } + }, + "Android_Nexus7HD": { + "desiredCapabilities": { + "browserName": "Browser", + "deviceName": "Google Nexus 7 HD Emulator", + "platformVersion": "4.4", + "platformName": "Android", + "deviceOrientation": "portrait" + } + } + } } diff --git a/ft.yml b/ft.yml index 0ace8235..bd78f99e 100644 --- a/ft.yml +++ b/ft.yml @@ -1,3 +1,3 @@ owner: - github: wheresrhys - email: rhys.evans@ft.com + github: wheresrhys + email: rhys.evans@ft.com diff --git a/tasks/deploy-hashed-assets.js b/tasks/deploy-hashed-assets.js index 391573fe..5da90996 100644 --- a/tasks/deploy-hashed-assets.js +++ b/tasks/deploy-hashed-assets.js @@ -12,9 +12,9 @@ const Metrics = require('next-metrics').Metrics; const AWS_ACCESS_HASHED_ASSETS = process.env.AWS_ACCESS_HASHED_ASSETS || process.env.aws_access_hashed_assets; const AWS_SECRET_HASHED_ASSETS = process.env.AWS_SECRET_HASHED_ASSETS || process.env.aws_secret_hashed_assets; -const bucket = 'ft-next-hashed-assets-prod'; +const euBucket = 'ft-next-hashed-assets-prod'; const usBucket = 'ft-next-hashed-assets-prod-us'; -const region = 'eu-west-1'; +const euRegion = 'eu-west-1'; const usRegion = 'us-east-1'; const gzip = denodeify(require('zlib').gzip); @@ -24,19 +24,19 @@ function task (opts) { aws.config.update({ accessKeyId: AWS_ACCESS_HASHED_ASSETS, secretAccessKey: AWS_SECRET_HASHED_ASSETS, - region + euRegion }); - const s3bucket = new aws.S3({ params: { Bucket: bucket } }); + function upload (bucket, params) { - function upload (params) { + const s3Bucket = new aws.S3({ params: { Bucket: bucket } }); return new Promise((resolve, reject) => { - return s3bucket.upload(params, (err, data) => { + return s3Bucket.upload(params, (err, data) => { if (err) { - console.error('Upload failed', err); // eslint-disable-line no-console + console.error(`Upload failed to ${bucket}`, err); // eslint-disable-line no-console reject(err); } else { - console.log('Upload success', data); // eslint-disable-line no-console + console.log(`Upload success to ${bucket}`, data); // eslint-disable-line no-console resolve(); } }); @@ -105,9 +105,12 @@ function task (opts) { params.ContentType = 'text/css; charset=utf-8'; break; } - return upload(params) + return Promise.all([ + upload(euBucket, params), + upload(usBucket, params) + ]) .then(() => Promise.all([ - waitForOk(`http://${bucket}.s3-website-${region}.amazonaws.com/${key}`), + waitForOk(`http://${euBucket}.s3-website-${euRegion}.amazonaws.com/${key}`), waitForOk(`http://${usBucket}.s3-website-${usRegion}.amazonaws.com/${key}`), isMonitoringAsset ? gzip(content) : Promise.resolve() ]))