Skip to content

Commit e527369

Browse files
committed
Merge branch 'feature/travis-integration' into dev
2 parents b3746f3 + 47dfc62 commit e527369

File tree

5 files changed

+49
-13
lines changed

5 files changed

+49
-13
lines changed

.travis.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,29 @@
11
language: node_js
22

33
node_js:
4-
- "4.1"
5-
- "4.0"
4+
- "4"
5+
- "5"
6+
- "6"
67

78
before_script:
8-
- npm install -g jscs@2
99
- npm install -g mocha
1010
- npm install -g gulp
1111

12+
before_install:
13+
- "npm install -g npm@latest"
14+
1215
install:
1316
- npm install
1417

1518
script:
1619
- npm test
20+
21+
env:
22+
- CXX=g++-4.8
23+
24+
addons:
25+
apt:
26+
sources:
27+
- ubuntu-toolchain-r-test
28+
packages:
29+
- g++-4.8

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Express-React-HMR-Boilerplate
22

3-
[![Build Status](https://travis-ci.org/gocreating/express-react-hmr-boilerplate.svg?branch=master)](https://travis-ci.org/gocreating/express-react-hmr-boilerplate)
3+
[![Build Status](https://travis-ci.org/gocreating/express-react-hmr-boilerplate.svg?branch=dev)](https://travis-ci.org/gocreating/express-react-hmr-boilerplate)
44
[![Dependency Status](https://david-dm.org/gocreating/express-react-hmr-boilerplate.svg)](https://david-dm.org/gocreating/express-react-hmr-boilerplate)
55

66
This is a boilerplate for scaffolding MERN stack projects with livereload feature supported.
@@ -204,7 +204,7 @@ git flow feature finish upgrade-mirror
204204

205205
### v1.0
206206

207-
- [ ] Travis Testing
207+
- [x] Travis Testing
208208
- [ ] Asynchronous redux-form validation (detect duplicate username/email)
209209
- [ ] Pagination Mechanism
210210

configs/project/server.js

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
1-
module.exports = {
2-
jwt: {
3-
secret: '4eO5viHe23',
4-
expiresIn: 60 * 60 * 24 * 3, // in seconds
5-
},
6-
mongo: require('./mongo/credential'),
7-
firebase: require('./firebase/credential.json'),
8-
};
1+
if (process.env.TRAVIS) {
2+
if (!process.env.PROJECT_SERVER_CONFIGS) {
3+
throw new Error(
4+
'Environment variable `PROJECT_SERVER_CONFIGS` is not set. ' +
5+
'Please dump by running `gulp dumpConfigs`'
6+
);
7+
}
8+
module.exports = JSON.parse(process.env.PROJECT_SERVER_CONFIGS);
9+
} else {
10+
module.exports = {
11+
jwt: {
12+
secret: '4eO5viHe23',
13+
expiresIn: 60 * 60 * 24 * 3, // in seconds
14+
},
15+
mongo: require('./mongo/credential'),
16+
firebase: require('./firebase/credential.json'),
17+
};
18+
}

gulpfile.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ var nodemon = require('gulp-nodemon');
1212
var notify = require('gulp-notify');
1313
var async = require('async');
1414
var mergeStream = require('merge-stream');
15+
var jsesc = require('jsesc');
1516

1617
// local modules
1718
var webpackConfig = {
@@ -238,6 +239,17 @@ gulp.task('deploy', function(cb) {
238239
], cbCmdDone);
239240
});
240241

242+
gulp.task('dumpConfigs', function() {
243+
var projectServerConfigs = require('./configs/project/server');
244+
var dumpValue = jsesc(JSON.stringify(projectServerConfigs), { json: true });
245+
console.log(gutil.colors.gray('\n\n======================='));
246+
console.log('Please follow the instructions:');
247+
console.log('1. Go to `https://travis-ci.org/<owner>/<repo>/settings`');
248+
console.log('2. Add new environment variable named `' + gutil.colors.yellow('PROJECT_SERVER_CONFIGS') + '`');
249+
console.log('3. Set its value as\n' + gutil.colors.yellow(dumpValue));
250+
console.log(gutil.colors.gray('=======================\n\n'));
251+
});
252+
241253
gulp.task('build:production', function() {
242254
gulp.start(
243255
'clean',

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
"gulp-notify": "^2.2.0",
8080
"gulp-sourcemaps": "^1.6.0",
8181
"gulp-util": "^3.0.7",
82+
"jsesc": "^2.2.0",
8283
"merge-stream": "^1.0.0",
8384
"node-sass": "^3.8.0",
8485
"postcss-loader": "^0.9.1",

0 commit comments

Comments
 (0)