Skip to content

Commit

Permalink
Merge branch 'feature/travis-integration' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
gocreating committed Oct 9, 2016
2 parents b3746f3 + 47dfc62 commit e527369
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 13 deletions.
19 changes: 16 additions & 3 deletions .travis.yml
@@ -1,16 +1,29 @@
language: node_js

node_js:
- "4.1"
- "4.0"
- "4"
- "5"
- "6"

before_script:
- npm install -g jscs@2
- npm install -g mocha
- npm install -g gulp

before_install:
- "npm install -g npm@latest"

install:
- npm install

script:
- npm test

env:
- CXX=g++-4.8

addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.8
4 changes: 2 additions & 2 deletions README.md
@@ -1,6 +1,6 @@
# Express-React-HMR-Boilerplate

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

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

### v1.0

- [ ] Travis Testing
- [x] Travis Testing
- [ ] Asynchronous redux-form validation (detect duplicate username/email)
- [ ] Pagination Mechanism

Expand Down
26 changes: 18 additions & 8 deletions configs/project/server.js
@@ -1,8 +1,18 @@
module.exports = {
jwt: {
secret: '4eO5viHe23',
expiresIn: 60 * 60 * 24 * 3, // in seconds
},
mongo: require('./mongo/credential'),
firebase: require('./firebase/credential.json'),
};
if (process.env.TRAVIS) {
if (!process.env.PROJECT_SERVER_CONFIGS) {
throw new Error(
'Environment variable `PROJECT_SERVER_CONFIGS` is not set. ' +
'Please dump by running `gulp dumpConfigs`'
);
}
module.exports = JSON.parse(process.env.PROJECT_SERVER_CONFIGS);
} else {
module.exports = {
jwt: {
secret: '4eO5viHe23',
expiresIn: 60 * 60 * 24 * 3, // in seconds
},
mongo: require('./mongo/credential'),
firebase: require('./firebase/credential.json'),
};
}
12 changes: 12 additions & 0 deletions gulpfile.js
Expand Up @@ -12,6 +12,7 @@ var nodemon = require('gulp-nodemon');
var notify = require('gulp-notify');
var async = require('async');
var mergeStream = require('merge-stream');
var jsesc = require('jsesc');

// local modules
var webpackConfig = {
Expand Down Expand Up @@ -238,6 +239,17 @@ gulp.task('deploy', function(cb) {
], cbCmdDone);
});

gulp.task('dumpConfigs', function() {
var projectServerConfigs = require('./configs/project/server');
var dumpValue = jsesc(JSON.stringify(projectServerConfigs), { json: true });
console.log(gutil.colors.gray('\n\n======================='));
console.log('Please follow the instructions:');
console.log('1. Go to `https://travis-ci.org/<owner>/<repo>/settings`');
console.log('2. Add new environment variable named `' + gutil.colors.yellow('PROJECT_SERVER_CONFIGS') + '`');
console.log('3. Set its value as\n' + gutil.colors.yellow(dumpValue));
console.log(gutil.colors.gray('=======================\n\n'));
});

gulp.task('build:production', function() {
gulp.start(
'clean',
Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -79,6 +79,7 @@
"gulp-notify": "^2.2.0",
"gulp-sourcemaps": "^1.6.0",
"gulp-util": "^3.0.7",
"jsesc": "^2.2.0",
"merge-stream": "^1.0.0",
"node-sass": "^3.8.0",
"postcss-loader": "^0.9.1",
Expand Down

0 comments on commit e527369

Please sign in to comment.