This repository has been archived by the owner on Aug 23, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 37
/
Gruntfile.js
80 lines (73 loc) · 1.93 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
module.exports = function(grunt) {
var env = process.env.NODE_ENV || "development";
var DBconfig = require('./db.config.json')[env];
var db = DBconfig.protocol +
'://' + DBconfig.username +
':' + DBconfig.password +
'@' + DBconfig.host +
':' + DBconfig.port +
'/' + DBconfig.database;
var gruntConfig = {
pkg : grunt.file.readJSON('package.json'),
jshint : {
files : [
'api/**/*.js'
],
options : {
'force' : true,
'validthis': true,
'laxcomma' : true,
'laxbreak' : true,
'browser' : true,
'eqnull' : true,
'debug' : true,
'devel' : true,
'boss' : true,
'expr' : true,
'asi' : true,
'sub' : true
}
},
watch : {
files : [
'api/**/*.js',
'db.config.json',
'deployment.environments.json',
'Gruntfile.js'
],
tasks : ['npm-install', 'jshint', 'develop'],
options : { nospawn: true, atBegin: true }
},
develop : {
server : {
file : 'api/app.js',
args : ['debug']
}
},
"couch-compile": {
app: {
files: {
"db/designdoc.json": "db/design/*"
}
}
},
"couch-push": {
options : {
user : DBconfig.username,
pass : DBconfig.password,
},
localhost : {
files : {}
}
}
};
gruntConfig["couch-push"].localhost.files[db] = "db/designdoc.json";
grunt.initConfig(gruntConfig);
grunt.loadNpmTasks('grunt-npm-install');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-develop');
grunt.loadTasks('./node_modules/grunt-couch/tasks');
grunt.registerTask('default', ['watch']);
grunt.registerTask('updateViews', ['couch-compile', 'couch-push']);
};