Browse Source

fix(dashboard/build): update gruntfile for release build

Ed Rooth 11 years ago
parent
commit
c08bcb6f5b
2 changed files with 26 additions and 9 deletions
  1. 22 5
      mod/dashboard/Gruntfile.js
  2. 4 4
      mod/dashboard/app/index.html

+ 22 - 5
mod/dashboard/Gruntfile.js

@@ -1,5 +1,7 @@
 'use strict';
 
+var util = require('util');
+
 module.exports = function(grunt) {
   /*jshint maxstatements:false */
 
@@ -37,7 +39,10 @@ module.exports = function(grunt) {
 
     concurrent: {
       dev: {
-        tasks: ['watch', /*'test-watch'*/],
+        tasks: [
+          'watch',
+          //'test-watch'
+        ],
         options: {
           logConcurrentOutput: true
         }
@@ -194,6 +199,17 @@ module.exports = function(grunt) {
           dest: '<%= config.distPath %>/img'
         }]
       },
+      'coreos-web': {
+        files: [{
+          cwd: '<%= config.appPath %>/coreos-web',
+          expand: true,
+          src: [
+            'fonts/*',
+            'img/*'
+          ],
+          dest: '<%= config.distPath %>/coreos-web'
+        }]
+      },
       'dist-static': {
         files: [
           {
@@ -229,7 +245,7 @@ module.exports = function(grunt) {
   grunt.registerTask('clean-paths', 'clean up resource paths', function() {
     grunt.log.writeln('cleaning paths...');
     function clean(path) {
-      return path.replace('cp/static/', '');
+      return path.replace('mod/dashboard/static/', '');
     }
     ['concat', 'uglify', 'cssmin'].forEach(function(task) {
       var config = grunt.config(task);
@@ -261,7 +277,7 @@ module.exports = function(grunt) {
 
   grunt.registerTask('dev', [
     'clean',
-    //'jshint',
+    'jshint',
     'views',
     'sass',
     'concurrent:dev'
@@ -271,7 +287,7 @@ module.exports = function(grunt) {
     'clean',
     'jshint',
     'views',
-    'test',
+    //'test',
     'sass',
     'useminPrepare',
     'clean-paths',
@@ -283,7 +299,8 @@ module.exports = function(grunt) {
     'usemin',
     'copy:dist-static',
     'clean:dist-static',
-    'copy:images'
+    'copy:images',
+    'copy:coreos-web'
   ]);
 
   grunt.registerTask('default', ['build']);

+ 4 - 4
mod/dashboard/app/index.html

@@ -7,7 +7,7 @@
     <title co-title co-title-suffix=" · etcd">etcd</title>
     <meta name="description" content="">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
-    <!-- build:css /cp/static/main.css -->
+    <!-- build:css /mod/dashboard/static/main.css -->
     <link rel="stylesheet" href="/mod/dashboard/static/coreos-web/coreos.css">
     <link rel="stylesheet" href="/mod/dashboard/static/compiled/main.css">
     <!-- endbuild -->
@@ -32,7 +32,7 @@
 
     <co-toast></co-toast>
 
-    <!-- build:js /cp/static/deps.js -->
+    <!-- build:js /mod/dashboard/static/deps.js -->
     <script src="/mod/dashboard/static/bower_components/jquery/dist/jquery.js"></script>
     <script src="/mod/dashboard/static/bower_components/angular/angular.js"></script>
     <script src="/mod/dashboard/static/bower_components/angular-route/angular-route.js"></script>
@@ -42,11 +42,11 @@
     <script src="/mod/dashboard/static/bower_components/underscore/underscore.js"></script>
     <script src="/mod/dashboard/static/bower_components/underscore.string/lib/underscore.string.js"></script>
     <script src="/mod/dashboard/static/bower_components/d3/d3.js"></script>
-    <script src="/mod/dashboard/static/coreos-web/coreos.js"></script>
+    <script src="/mod/dashboard/static/coreos-web/coreos.min.js"></script>
     <script src="/mod/dashboard/static/vega.js"></script>
     <!-- endbuild -->
 
-    <!-- build:js /cp/static/app.js -->
+    <!-- build:js /mod/dashboard/static/app.js -->
     <script src="/mod/dashboard/static/compiled/views.js"></script>
     <script src="/mod/dashboard/static/etcd-dashboard.js"></script>
     <script src="/mod/dashboard/static/module/etcd-api.js"></script>