grafana 268 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. commit 5a3d3f5098c3dfe42d4fbe63f3c43d0d1a154d8a
  2. Author: Torkel Ödegaard <torkel.odegaard@gmail.com>
  3. Date: Sun Jan 4 17:51:48 2015 +0100
  4. updated build and release tasks
  5. diff --git a/Gruntfile.js b/Gruntfile.js
  6. index 6b2554f87..3caf8cdd2 100644
  7. --- a/Gruntfile.js
  8. +++ b/Gruntfile.js
  9. @@ -13,6 +13,7 @@ module.exports = function (grunt) {
  10. config.mode = grunt.option('mode') || 'standalone';
  11. config.modeOptions = {
  12. + zipSuffix: '',
  13. requirejs: {
  14. paths: { config: '../config.sample' },
  15. excludeConfig: true,
  16. @@ -20,6 +21,8 @@ module.exports = function (grunt) {
  17. };
  18. if (config.mode === 'backend') {
  19. + grunt.log.writeln('Setting backend build mode');
  20. + config.modeOptions.zipSuffix = '-backend';
  21. config.modeOptions.requirejs.path = { config: 'components/config' };
  22. config.modeOptions.requirejs.excludeConfig = true;
  23. }
  24. diff --git a/package.json b/package.json
  25. index 284e8fc30..55e66649b 100644
  26. --- a/package.json
  27. +++ b/package.json
  28. @@ -4,7 +4,7 @@
  29. "company": "Coding Instinct AB"
  30. },
  31. "name": "grafana",
  32. - "version": "1.9.1",
  33. + "version": "2.0.0-alpha",
  34. "repository": {
  35. "type": "git",
  36. "url": "http://github.com/torkelo/grafana.git"
  37. @@ -16,7 +16,7 @@
  38. "grunt-angular-templates": "^0.5.5",
  39. "grunt-cli": "~0.1.13",
  40. "grunt-contrib-clean": "~0.5.0",
  41. - "grunt-contrib-compress": "~0.5.2",
  42. + "grunt-contrib-compress": "~0.13.0",
  43. "grunt-contrib-concat": "^0.4.0",
  44. "grunt-contrib-connect": "~0.5.0",
  45. "grunt-contrib-copy": "~0.5.0",
  46. diff --git a/tasks/build_task.js b/tasks/build_task.js
  47. index e605a54a8..6d176cc60 100644
  48. --- a/tasks/build_task.js
  49. +++ b/tasks/build_task.js
  50. @@ -1,4 +1,5 @@
  51. module.exports = function(grunt) {
  52. + "use strict";
  53. // Concat and Minify the src directory into dist
  54. grunt.registerTask('build', [
  55. @@ -32,6 +33,7 @@ module.exports = function(grunt) {
  56. src: '**/*',
  57. dest: '<%= tempDir %>/public/',
  58. });
  59. + grunt.config('clean.dest_dir', ['<%= destDir %>']);
  60. grunt.config('copy.backend_bin', {
  61. cwd: '../bin',
  62. expand: true,
  63. @@ -46,6 +48,7 @@ module.exports = function(grunt) {
  64. dest: '<%= tempDir %>'
  65. });
  66. grunt.task.run('copy:dist_to_tmp');
  67. + grunt.task.run('clean:dest_dir');
  68. grunt.task.run('copy:backend_bin');
  69. grunt.task.run('copy:backend_conf');
  70. }
  71. diff --git a/tasks/options/compress.js b/tasks/options/compress.js
  72. index 66038af6a..4ad42ef41 100644
  73. --- a/tasks/options/compress.js
  74. +++ b/tasks/options/compress.js
  75. @@ -38,7 +38,7 @@ module.exports = function(config) {
  76. },
  77. zip_release: {
  78. options: {
  79. - archive: '<%= destDir %>/<%= pkg.name %>-<%= pkg.version %>.zip'
  80. + archive: '<%= destDir %>/<%= pkg.name %><%= modeOptions.zipSuffix %>-<%= pkg.version %>.zip'
  81. },
  82. files : [
  83. {
  84. @@ -56,7 +56,7 @@ module.exports = function(config) {
  85. },
  86. tgz_release: {
  87. options: {
  88. - archive: '<%= destDir %>/<%= pkg.name %>-<%= pkg.version %>.tar.gz'
  89. + archive: '<%= destDir %>/<%= pkg.name %><%= modeOptions.zipSuffix %>-<%= pkg.version %>.tar.gz'
  90. },
  91. files : [
  92. {