-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
86 lines (80 loc) · 2.2 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
module.exports = function(grunt) {
// load dependencies
grunt.loadNpmTasks("grunt-git");
// Project configuration.
grunt.initConfig({
gitcheckout: {
ghpages: {
options: {
branch: "gh-pages"
}
},
master: {
options: {
branch: "master"
}
}
},
gitmerge: {
master: {
options: {
branch: "master",
noff: true,
noEdit: true
}
}
},
generate: {
files: {
// src: dest
'js/vendor/bootstrap/dist/js/bootstrap.min.js': 'js/bootstrap.min.js',
'js/vendor/handlebars/handlebars.min.js': 'js/handlebars.min.js',
'js/vendor/jquery/dist/jquery.min.js': 'js/jquery.min.js',
'js/vendor/modernizr/modernizr.js': 'js/modernizr.js',
'js/vendor/requirejs/require.js': 'js/require.js',
'js/vendor/openraffler/src/raffler.js': 'js/raffler.js',
'js/vendor/openraffler/src/drivers/joindin.js': 'js/joindin.js'
}
},
gitadd: {
all: {
options: {
force: false,
all: true
}
}
},
gitcommit: {
ghpages: {
options: {
message: 'Deploying...',
noVerify: true,
noStatus: false,
allowEmpty: true
}
}
},
gitpush: {
origin: {
options: {
remote: "origin",
branch: "gh-pages"
}
}
}
});
// deploy
grunt.registerTask("deploy", ["gitcheckout:ghpages", "gitmerge:master", "generate", "gitadd:all", "gitcommit:ghpages", "gitpush:origin", "gitcheckout:master"]);
grunt.registerTask("generate", function(){
grunt.log.writeln('Generating files...');
var files = grunt.config.get(this.name + '.files');
for (var src in files) {
var dest = files[src];
if (grunt.file.exists(dest)) {
grunt.file.delete(dest, {force:true});
}
grunt.file.copy(src, dest);
grunt.log.writeln("Copying [" + src + "] to [" + dest + "]").ok();
}
});
};