forked from elastic/sense
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Gruntfile.js
116 lines (104 loc) · 2.07 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
108
109
110
111
112
113
114
115
116
module.exports = function (grunt) {
require('jit-grunt')(grunt, {
s3: 'grunt-aws',
eslint: 'gruntify-eslint'
});
const srcFiles = [
{
expand: true,
src: [
'public/**',
'!public/tests/**',
'api_server/**',
'index.js',
'LICENSE.md',
'package.json',
'README.md',
],
dest: 'build/sense-<%= pkg.version %>'
}
];
const replaceSrcFiles = [
{
expand: true,
src: [
'public/**/*.js',
'public/**/*.css',
'!public/tests/**',
'api_server/**',
'index.js',
'LICENSE.md',
'package.json',
'README.md',
],
dest: 'build/sense-<%= pkg.version %>'
}
];
grunt.initConfig({
pkg: require('./package.json'),
clean: {
build: { src: 'build' },
target: { src: 'target' },
},
compress: {
build: {
options: {
mode: 'tgz',
archive: 'target/sense-<%= pkg.version %>.tar.gz'
},
files: [
{
expand: true,
cwd: 'build/',
src: ['**'],
dest: ''
},
]
}
},
copy: {
build: {
files: srcFiles
}
},
s3: {
release: {
options: {
bucket: 'download.elasticsearch.org',
access: 'private',
gzip: false
},
files: [
{
src: 'target/sense-<%= pkg.version %>.tar.gz',
dest: 'elasticsearch/sense/sense-<%= pkg.version %>.tar.gz'
}
]
}
},
eslint: {
source: {
src: [
'public/**/*.js',
'!**/webpackShims/**'
]
}
},
gitinfo: {},
replace: {
build: {
options: {
patterns: [
{
match: 'SENSE_REVISION',
replacement: '<%= gitinfo.local.branch.current.SHA %>'
}
]
},
files: replaceSrcFiles
}
}
});
require('./tasks/build')(grunt);
require('./tasks/release')(grunt);
};