-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathGruntfile.js
107 lines (105 loc) · 2.13 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
107
module.exports = function(grunt) {
grunt.initConfig({
clean: ['./bin'],
connect: {
site: {
options: {
hostname: '*',
port: 8080,
livereload: true,
base: ['./bower_components', './www', './bin']
}
}
},
less: {
site: {
files: {
'./bin/css/main.css': './www/less/main.less'
}
}
},
ejs: {
site: {
options: grunt.file.readJSON('package.json'),
src: ['./www/ejs/*.ejs'],
dest: './bin/index.html',
expand: false,
ext: '.html',
}
},
copy: {
site: {
expand: true,
cwd: './www',
src: ['js/**/*.js', 'fonts/*.*', 'img/*.*'],
dest: './bin'
},
bower: {
expand: true,
cwd: './bower_components',
src: ['**/*.*'],
dest: './bin'
}
},
watch: {
less: {
files: ['./www/less/*.less'],
tasks: ['less'],
options: {
livereload: true
}
},
ejs: {
files: ['./www/ejs/**/*.ejs'],
tasks: ['ejs']
}
},
perfjankie: {
options: {
suite: 'perfSlides - Performance Analysis',
urls: ['http://localhost:8080']
},
local: {
options: {
selenium: 'http://localhost:4444/wd/hub',
browsers: 'chrome',
couch: {
server: 'http://localhost:5984',
username: 'admin_user',
pwd: 'admin_pass',
database: 'perfslides',
updateSite: true
}
}
},
remote: {
options: {
repeat: 3,
selenium: {
hostname: "ondemand.saucelabs.com",
port: "80",
user: process.env.SAUCE_USERNAME,
pwd: process.env.SAUCE_ACCESSKEY
},
browsers: [{
browserName: 'chrome',
version: 34
}],
couch: {
server: 'http://axemclion.cloudant.com',
username: process.env.COUCH_USER,
pwd: process.env.COUCH_PWD,
database: 'perfslides',
updateSite: true
}
}
}
}
});
grunt.loadNpmTasks('perfjankie');
grunt.loadTasks('./build');
require('load-grunt-tasks')(grunt);
grunt.registerTask('build', ['copy', 'less', 'ejs']);
grunt.registerTask('default', ['clean', 'build', 'connect', 'watch']);
grunt.registerTask('perf', ['clean', 'build', 'connect', 'gitData', 'perfjankie:local'])
};