-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gruntfile.js
63 lines (54 loc) · 1.47 KB
/
Gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
var config = require( __dirname + '/config/environment.js' );
module.exports = function (grunt) {
grunt.initConfig({
migrate: {
options: {
config: './lib/data/database.json',
'migrations-dir': './lib/data/migrations',
verbose: true,
env: {
DATABASE_URL: 'postgres://' + config.get('DATABASE_USER') + ':' + config.get('DATABASE_PASSWORD') + '@' + config.get('DATABASE_HOST') + ':' + config.get('DATABASE_PORT') + '/' + config.get('DATABASE_NAME')
}
}
},
jsdoc : {
dist : {
src: ['./index.js', './lib/api/*.js'],
options: {
destination: './doc/jsdoc'
}
}
},
mochaTest: {
test: {
options: {
reporter: 'spec'
},
src: ['test/models/**/*.js']
}
},
jshint: {
files: [
'Gruntfile.js',
'index.js',
'package.json',
'bin/gateway',
'config/*',
'lib/**/*.js',
'!lib/data/migrations/*.js',
'!lib/data/node_modules/**/*.js',
'!lib/http/controllers/admin/login.js',
'processes/**/*.js'
],
options: {
jshintrc: '.jshintrc'
}
}
});
grunt.loadNpmTasks('grunt-db-migrate');
grunt.loadNpmTasks('grunt-jsdoc');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-mocha-test');
grunt.registerTask('test', ['jshint', 'mochaTest:test']);
grunt.registerTask('default', ['migrate']);
};