-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGruntfile.js
More file actions
42 lines (42 loc) · 1.33 KB
/
Gruntfile.js
File metadata and controls
42 lines (42 loc) · 1.33 KB
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
/* jshint node:true */
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt, {
scope: 'devDependencies'
});
require('load-grunt-config')(grunt, {
// the path where all the grunt task live is grunt/tasks
configPath: require("path").join(process.cwd(), 'grunt', 'tasks'),
// data is passed into the tasks
data: {
// settings are a way to override the defaults.
settings: {
// defaults, these can be removed.
clean: "dist/*",
jshint: "src/**/*.js",
jsbeautifier: "src/**/*.js",
watch: ["Gruntfile.js", "src/**/*", "test/**/*"],
watchTasks: "default"
}
}
});
grunt.registerTask('deploy-s3', 'deploy to s3', function() {
var branch = grunt.option("branch");
grunt.config("awsAccessKey", grunt.option("awsAccessKey"));
grunt.config("awsSecretKey", grunt.option("awsSecretKey"));
if (branch !== "master") {
grunt.config("buildNumber", "-" + grunt.option("build"));
grunt.task.run("replace:sourceMapArchiveS3");
grunt.task.run("aws_s3:build");
} else {
grunt.task.run("replace:sourceMapReleaseS3");
grunt.task.run("aws_s3:release");
}
});
grunt.registerTask('deploy', 'deploy to svn', function() {
grunt.config("svnDir", grunt.option("dir"));
if (grunt.option("build")) {
grunt.config("buildNumber", "-" + grunt.option("build"));
}
grunt.task.run("push_svn");
});
};