-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGruntfile.js
More file actions
74 lines (71 loc) · 2.85 KB
/
Gruntfile.js
File metadata and controls
74 lines (71 loc) · 2.85 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
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
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
secret: grunt.file.readJSON('credentials.json'),
environments: {
options: {
current_symlink: 'current',
local_path: 'product'
},
staging: {
options: {
host: '<%= secret.credentials.host %>',
username: '<%= secret.credentials.username %>',
password: '<%= secret.credentials.password %>',
port: '<%= secret.credentials.port %>',
deploy_path: '/home/dustman/dustweb.org/javascript/workflow/project1/staging',
debug: true,
release_to_keep: '5'
}
},
production: {
options: {
host: '<%= secret.credentials.host %>',
username: '<%= secret.credentials.username %>',
password: '<%= secret.credentials.password %>',
port: '<%= secret.credentials.port %>',
deploy_path: '/home/dustman/dustweb.org/javascript/workflow/project1/production',
release_to_keep: '5'
}
}
},
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
},
build: {
src: 'product/<%= pkg.name %>.bundle.js',
dest: 'product/<%= pkg.name %>.bundle.min.js'
}
},
jshint: {
all: ['Gruntfile.js', '*.json', 'app/**/*.js']
},
browserify: {
'./product/<%= pkg.name %>.bundle.js': ['./app/<%= pkg.name %>.js']
},
shell: {
create_product_dir: "mkdir -p product",
cp_index_to_product: "cp app/index.html product",
cp_assets_to_product: "cp -r app/assets product"
}
});
// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-ssh-deploy');
grunt.loadNpmTasks('grunt-browserify');
grunt.loadNpmTasks('grunt-shell');
// Default task(s).
grunt.registerTask('default', ['browserify']);
grunt.registerTask('default', ['uglify']);
grunt.registerTask('default', ['jshint']);
grunt.registerTask('build', ['jshint',
'shell:create_product_dir',
'shell:cp_index_to_product',
'shell:cp_assets_to_product',
'browserify',
'uglify']);
grunt.registerTask('deploy', ['ssh_deploy:staging']);
};