Commit 5a3d3f50 by Torkel Ödegaard

updated build and release tasks

parent 55bc1507
...@@ -13,6 +13,7 @@ module.exports = function (grunt) { ...@@ -13,6 +13,7 @@ module.exports = function (grunt) {
config.mode = grunt.option('mode') || 'standalone'; config.mode = grunt.option('mode') || 'standalone';
config.modeOptions = { config.modeOptions = {
zipSuffix: '',
requirejs: { requirejs: {
paths: { config: '../config.sample' }, paths: { config: '../config.sample' },
excludeConfig: true, excludeConfig: true,
...@@ -20,6 +21,8 @@ module.exports = function (grunt) { ...@@ -20,6 +21,8 @@ module.exports = function (grunt) {
}; };
if (config.mode === 'backend') { if (config.mode === 'backend') {
grunt.log.writeln('Setting backend build mode');
config.modeOptions.zipSuffix = '-backend';
config.modeOptions.requirejs.path = { config: 'components/config' }; config.modeOptions.requirejs.path = { config: 'components/config' };
config.modeOptions.requirejs.excludeConfig = true; config.modeOptions.requirejs.excludeConfig = true;
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"company": "Coding Instinct AB" "company": "Coding Instinct AB"
}, },
"name": "grafana", "name": "grafana",
"version": "1.9.1", "version": "2.0.0-alpha",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "http://github.com/torkelo/grafana.git" "url": "http://github.com/torkelo/grafana.git"
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
"grunt-angular-templates": "^0.5.5", "grunt-angular-templates": "^0.5.5",
"grunt-cli": "~0.1.13", "grunt-cli": "~0.1.13",
"grunt-contrib-clean": "~0.5.0", "grunt-contrib-clean": "~0.5.0",
"grunt-contrib-compress": "~0.5.2", "grunt-contrib-compress": "~0.13.0",
"grunt-contrib-concat": "^0.4.0", "grunt-contrib-concat": "^0.4.0",
"grunt-contrib-connect": "~0.5.0", "grunt-contrib-connect": "~0.5.0",
"grunt-contrib-copy": "~0.5.0", "grunt-contrib-copy": "~0.5.0",
......
module.exports = function(grunt) { module.exports = function(grunt) {
"use strict";
// Concat and Minify the src directory into dist // Concat and Minify the src directory into dist
grunt.registerTask('build', [ grunt.registerTask('build', [
...@@ -32,6 +33,7 @@ module.exports = function(grunt) { ...@@ -32,6 +33,7 @@ module.exports = function(grunt) {
src: '**/*', src: '**/*',
dest: '<%= tempDir %>/public/', dest: '<%= tempDir %>/public/',
}); });
grunt.config('clean.dest_dir', ['<%= destDir %>']);
grunt.config('copy.backend_bin', { grunt.config('copy.backend_bin', {
cwd: '../bin', cwd: '../bin',
expand: true, expand: true,
...@@ -46,6 +48,7 @@ module.exports = function(grunt) { ...@@ -46,6 +48,7 @@ module.exports = function(grunt) {
dest: '<%= tempDir %>' dest: '<%= tempDir %>'
}); });
grunt.task.run('copy:dist_to_tmp'); grunt.task.run('copy:dist_to_tmp');
grunt.task.run('clean:dest_dir');
grunt.task.run('copy:backend_bin'); grunt.task.run('copy:backend_bin');
grunt.task.run('copy:backend_conf'); grunt.task.run('copy:backend_conf');
} }
......
...@@ -38,7 +38,7 @@ module.exports = function(config) { ...@@ -38,7 +38,7 @@ module.exports = function(config) {
}, },
zip_release: { zip_release: {
options: { options: {
archive: '<%= destDir %>/<%= pkg.name %>-<%= pkg.version %>.zip' archive: '<%= destDir %>/<%= pkg.name %><%= modeOptions.zipSuffix %>-<%= pkg.version %>.zip'
}, },
files : [ files : [
{ {
...@@ -56,7 +56,7 @@ module.exports = function(config) { ...@@ -56,7 +56,7 @@ module.exports = function(config) {
}, },
tgz_release: { tgz_release: {
options: { options: {
archive: '<%= destDir %>/<%= pkg.name %>-<%= pkg.version %>.tar.gz' archive: '<%= destDir %>/<%= pkg.name %><%= modeOptions.zipSuffix %>-<%= pkg.version %>.tar.gz'
}, },
files : [ files : [
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment