Skip to content

Commit aeff56b

Browse files
committed
chore(*) fail TRAVIS if build errors
1 parent df6a37e commit aeff56b

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

protractor.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ if (process.env.TRAVIS) {
5151
config.sauceUser = process.env.SAUCE_USERNAME;
5252
config.sauceKey = process.env.SAUCE_ACCESS_KEY;
5353
config.capabilities = {
54-
'name': 'react-es6-redux E2E',
54+
'name': 'react-es6-redux E2E node v' + process.env.TRAVIS_NODE_VERSION,
5555
'browserName': 'chrome',
5656
'seleniumVersion': '2.48.2',
5757
'chromedriverVersion': '2.20',

webpack.config.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,13 @@ const NODE_ENV = process.env.NODE_ENV ? process.env.NODE_ENV.toLowerCase() : 'de
1919
const DEVTOOLS = process.env.DEVTOOLS ? JSON.parse(process.env.DEVTOOLS) : false;
2020
const API_ROOT_URL = process.env.API_ROOT_URL ? process.env.API_ROOT_URL : 'https://api.github.com';
2121
const DISABLE_LINTER = process.env.DISABLE_LINTER ? JSON.parse(process.env.DISABLE_LINTER) : false;
22+
const TRAVIS = process.env.TRAVIS ? JSON.parse(process.env.TRAVIS) : false;
2223

2324
const SOURCEMAPS_ACTIVE = NODE_ENV !== 'production' || DEVTOOLS === true;
2425

26+
if(TRAVIS) {
27+
console.log('TRAVIS mode (will fail on error)');
28+
}
2529
if(NODE_ENV === 'production'){
2630
console.log('PRODUCTION mode');
2731
}
@@ -50,7 +54,9 @@ const hash = (NODE_ENV === 'production' && DEVTOOLS ? '-devtools' : '') + (NODE_
5054

5155
/** plugins setup */
5256

53-
plugins.push(new webpack.NoErrorsPlugin());
57+
if(!TRAVIS) {
58+
plugins.push(new webpack.NoErrorsPlugin());
59+
}
5460
// extract css into one main.css file
5561
plugins.push(new ExtractTextPlugin('css/main' + hash + '.css',{
5662
disable: false,
@@ -130,6 +136,7 @@ else if(MODE_DEV_SERVER === false && DEVTOOLS === true){
130136
/** webpack config */
131137

132138
var config = {
139+
bail: TRAVIS,
133140
entry: {
134141
"js/bundle": "./src/bootstrap.js",
135142
"css/main": "./src/style/main.scss"

0 commit comments

Comments
 (0)