mirror of
https://github.com/grafana/grafana.git
synced 2025-08-02 12:02:18 +08:00
Progress on deb and rpm packaging, renamed config files, added file logging, #1476
This commit is contained in:
@ -14,56 +14,41 @@ module.exports = function(grunt) {
|
||||
'htmlmin:build',
|
||||
'ngtemplates',
|
||||
'cssmin:build',
|
||||
'build:grafanaVersion',
|
||||
'ngAnnotate:build',
|
||||
'requirejs:build',
|
||||
'concat:js',
|
||||
'filerev',
|
||||
'usemin',
|
||||
'clean:temp',
|
||||
//'uglify:dest'
|
||||
'uglify:dest'
|
||||
]);
|
||||
|
||||
grunt.registerTask('build-post-process', function() {
|
||||
var mode = grunt.config.get('mode');
|
||||
if (mode === 'backend') {
|
||||
grunt.config('copy.dist_to_tmp', {
|
||||
expand: true,
|
||||
cwd: '<%= destDir %>',
|
||||
src: '**/*',
|
||||
dest: '<%= tempDir %>/public/',
|
||||
});
|
||||
grunt.config('clean.dest_dir', ['<%= destDir %>']);
|
||||
grunt.config('copy.backend_bin', {
|
||||
cwd: 'bin',
|
||||
expand: true,
|
||||
src: ['grafana'],
|
||||
options: { mode: true},
|
||||
dest: '<%= tempDir %>'
|
||||
});
|
||||
grunt.config('copy.backend_files', {
|
||||
expand: true,
|
||||
src: ['conf/grafana.ini', 'vendor/**/*', 'scripts/*'],
|
||||
options: { mode: true},
|
||||
dest: '<%= tempDir %>'
|
||||
});
|
||||
grunt.task.run('copy:dist_to_tmp');
|
||||
grunt.task.run('clean:dest_dir');
|
||||
grunt.task.run('copy:backend_bin');
|
||||
grunt.task.run('copy:backend_files');
|
||||
}
|
||||
});
|
||||
|
||||
grunt.registerTask('build:grafanaVersion', function() {
|
||||
grunt.config('string-replace.config', {
|
||||
files: {
|
||||
'<%= tempDir %>/app/app.js': '<%= tempDir %>/app/app.js'
|
||||
},
|
||||
options: {
|
||||
replacements: [{ pattern: /@grafanaVersion@/g, replacement: '<%= pkg.version %>' }]
|
||||
}
|
||||
grunt.config('copy.dist_to_tmp', {
|
||||
expand: true,
|
||||
cwd: '<%= destDir %>',
|
||||
src: '**/*',
|
||||
dest: '<%= tempDir %>/public/',
|
||||
});
|
||||
grunt.task.run('string-replace:config');
|
||||
grunt.config('clean.dest_dir', ['<%= destDir %>']);
|
||||
grunt.config('copy.backend_bin', {
|
||||
cwd: 'bin',
|
||||
expand: true,
|
||||
src: ['grafana'],
|
||||
options: { mode: true},
|
||||
dest: '<%= tempDir %>'
|
||||
});
|
||||
grunt.config('copy.backend_files', {
|
||||
expand: true,
|
||||
src: ['conf/defaults.ini', 'vendor/**/*', 'scripts/*'],
|
||||
options: { mode: true},
|
||||
dest: '<%= tempDir %>'
|
||||
});
|
||||
|
||||
grunt.task.run('copy:dist_to_tmp');
|
||||
grunt.task.run('clean:dest_dir');
|
||||
grunt.task.run('copy:backend_bin');
|
||||
grunt.task.run('copy:backend_files');
|
||||
});
|
||||
|
||||
};
|
||||
|
Reference in New Issue
Block a user