-
Notifications
You must be signed in to change notification settings - Fork 70
/
Gruntfile.js
106 lines (99 loc) · 2.35 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
module.exports = function (grunt) {
'use strict';
var secret = {};
try {
secret = grunt.file.readJSON('secret.json');
} catch (err) {}
// Project configuration.
grunt.initConfig({
// secret.json contains the host, username and password for a server to
// run the tests on.
secret: secret,
test: {
files: ['test/**/*.js']
},
nodeunit: {
files: ['test/**/*.js']
},
beautify: {
files: '<%= jshint.files %>'
},
watch: {
files: '<%= jshint.files %>',
tasks: 'default'
},
bump: {
options: {
pushTo: 'origin'
}
},
jshint: {
options: {
curly: true,
eqeqeq: true,
immed: true,
latedef: true,
newcap: true,
noarg: true,
sub: true,
undef: true,
boss: true,
eqnull: true,
node: true,
globals: {
exports: true
}
},
files: ['Gruntfile.js', 'tasks/**/*.js', 'test/**/*.js']
},
sftp: {
test: {
files: {
"./": "tasks/**/*.js"
},
options: {
path: '/tmp',
host: '<%= secret.host %>',
username: '<%= secret.username %>',
// password auth
password: '<%= secret.password %>'
// private key auth
/*
privateKey: grunt.file.read('id_rsa'),
passphrase: '<%= secret.passphrase %>',
*/
// create directories
/*
path: "/tmp/does/not/exist/",
createDirectories: true
*/
}
}
},
sshexec: {
test: {
// single command
// command: 'uptime',
// multiple commands
command: ['uptime', 'ls', 'uptime'],
options: {
host: secret.host,
username: secret.username,
// private key auth
//privateKey: grunt.file.read(secret.privateKeyPath),
passphrase: secret.passphrase
}
}
}
});
// Actually load this plugin's tasks
grunt.loadTasks('tasks');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-beautify');
grunt.loadNpmTasks('grunt-bump');
grunt.loadNpmTasks('grunt-npm');
grunt.loadNpmTasks('grunt-contrib-nodeunit');
// Default task.
grunt.registerTask('default', ['jshint', 'nodeunit']);
grunt.registerTask('tidy', ['beautify']);
};