Progress on deb and rpm packaging, renamed config files, added file logging, #1476

This commit is contained in:
Torkel Ödegaard
2015-03-03 10:18:24 +01:00
parent f5cd3d853d
commit 7e0f1a57af
18 changed files with 446 additions and 202 deletions

View File

@@ -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');
});
};

View File

@@ -38,7 +38,7 @@ module.exports = function(config) {
},
zip_release: {
options: {
archive: '<%= destDir %>/<%= pkg.name %><%= modeOptions.zipSuffix %>-<%= pkg.version %>.zip'
archive: '<%= destDir %>/<%= pkg.name %>-<%= pkg.version %>.zip'
},
files : [
{
@@ -56,7 +56,7 @@ module.exports = function(config) {
},
tgz_release: {
options: {
archive: '<%= destDir %>/<%= pkg.name %><%= modeOptions.zipSuffix %>-<%= pkg.version %>.tar.gz'
archive: '<%= destDir %>/<%= pkg.name %>-<%= pkg.version %>.tar.gz'
},
files : [
{

View File

@@ -6,9 +6,8 @@ module.exports = function(config,grunt) {
var options = {
appDir: '<%= tempDir %>',
dir: '<%= destDir %>',
mainConfigFile: '<%= tempDir %>/app/components/require.<%= mode %>.js',
mainConfigFile: '<%= tempDir %>/app/components/require.config.js',
baseUrl: './app',
paths: config.modeOptions.requirejs.paths,
modules: [], // populated below,
@@ -60,8 +59,7 @@ module.exports = function(config,grunt) {
'directives/all',
'filters/all',
'controllers/all',
'routes/standalone/all',
'routes/backend/all',
'routes/all',
'components/partials',
]
}
@@ -76,15 +74,6 @@ module.exports = function(config,grunt) {
requireModules[0].include.push('text!panels/'+panelName+'/module.html');
});
if (config.modeOptions.requirejs.excludeConfig) {
// exclude the literal config definition from all modules
requireModules
.forEach(function (module) {
module.excludeShallow = module.excludeShallow || [];
module.excludeShallow.push('config');
});
}
return { options: options };
}

View File

@@ -2,7 +2,7 @@ module.exports = function(config) {
return {
dest: {
expand: true,
src: ['**/*.js', '!config.sample.js', '!app/dashboards/*.js', '!app/dashboards/**/*.js',],
src: ['**/*.js', '!dashboards/*.js'],
dest: '<%= destDir %>',
cwd: '<%= destDir %>',
options: {
@@ -13,4 +13,4 @@ module.exports = function(config) {
}
}
};
};
};