You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by mi...@apache.org on 2017/01/13 02:16:49 UTC

zeppelin git commit: [ZEPPELIN-1229] Clear browser cache with version hashtag.

Repository: zeppelin
Updated Branches:
  refs/heads/master b9c667ae1 -> 02323e283


[ZEPPELIN-1229] Clear browser cache with version hashtag.

### What is this PR for?
This PR avoids browser cache.

### What type of PR is it?
Bug Fix

### What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-1229

### How should this be tested?
1. Run old version of zeppelin(I was using 0.6.1) and show main page up in your browser.
2. Stop zeppelin.
3. Run this PR of Zeppelin and show page up on the same browser of 1.
4. check main page changed.

- before (Job menu doesn't show)
![2017-01-06 01_50_29](https://cloud.githubusercontent.com/assets/3348133/21728478/43aec6d0-d3fb-11e6-84ce-9e1b18853611.gif)

- after (Job menu show)
![2017-01-06 01_55_10](https://cloud.githubusercontent.com/assets/3348133/21728482/4a794e72-d3fb-11e6-8934-d6f92d65889b.gif)

### Questions:
* Does the licenses files need update? no
* Is there breaking changes for older versions? no
* Does this needs documentation? no

Author: astroshim <hs...@zepl.com>

Closes #1858 from astroshim/ZEPPELIN-1229 and squashes the following commits:

18defbe [astroshim] modify regx
85e0a05 [astroshim] remove arguments in code
ca09eac [astroshim] change path
13d8056 [astroshim] trying another way
6b554e0 [astroshim] Merge branch 'master' into ZEPPELIN-1229
655dc3d [astroshim] tag all html
c94de90 [astroshim] delete unnecessary codes
9d9f76f [astroshim] fix ZEPPELIN-1229


Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/02323e28
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/02323e28
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/02323e28

Branch: refs/heads/master
Commit: 02323e283c6cce12bb06bf5327420c2d2da5cbe2
Parents: b9c667a
Author: astroshim <hs...@zepl.com>
Authored: Tue Jan 10 22:02:00 2017 -0800
Committer: Mina Lee <mi...@apache.org>
Committed: Fri Jan 13 11:16:41 2017 +0900

----------------------------------------------------------------------
 zeppelin-web/Gruntfile.js | 28 +++++++++++++++++++++++++++-
 zeppelin-web/package.json |  1 +
 2 files changed, 28 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/02323e28/zeppelin-web/Gruntfile.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/Gruntfile.js b/zeppelin-web/Gruntfile.js
index 4266847..ab2c539 100644
--- a/zeppelin-web/Gruntfile.js
+++ b/zeppelin-web/Gruntfile.js
@@ -31,12 +31,16 @@ module.exports = function(grunt) {
   // Time how long tasks take. Can help when optimizing build times
   require('time-grunt')(grunt);
 
+  require('grunt-replace')(grunt);
+
   // Configurable paths for the application
   var appConfig = {
     app: require('./bower.json').appPath || 'src',
     dist: 'dist'
   };
 
+  var buildtime = Date.now();
+
   // Define the configuration for all the tasks
   grunt.initConfig({
 
@@ -415,6 +419,27 @@ module.exports = function(grunt) {
       ],
     },
 
+    replace: {
+      dist: {
+        options: {
+          patterns: [
+            {
+              match: /(templateUrl:"[^\.\s]+\.html)/g,
+              replacement: '$1' + '?v=' + buildtime
+            },
+            {
+              match: /(ng-include src="'[^\.\s]+\.html)/g,
+              replacement: '$1' + '?v=' + buildtime
+            }
+          ]
+        },
+        files: [
+          {src: ['dist/**/*.html'], dest: './'},
+          {src: ['dist/*.js'], dest: './'}
+        ]
+      }
+    },
+
     // Test settings
     karma: {
       unit: {
@@ -451,7 +476,8 @@ module.exports = function(grunt) {
     'uglify',
     'usemin',
     'htmlmin',
-    'cacheBust'
+    'replace',
+    'cacheBust',
   ]);
 
   grunt.registerTask('default', [

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/02323e28/zeppelin-web/package.json
----------------------------------------------------------------------
diff --git a/zeppelin-web/package.json b/zeppelin-web/package.json
index ed1cb16..49bc046 100644
--- a/zeppelin-web/package.json
+++ b/zeppelin-web/package.json
@@ -52,6 +52,7 @@
     "grunt-newer": "^0.7.0",
     "grunt-ng-annotate": "^0.10.0",
     "grunt-postcss": "^0.7.1",
+    "grunt-replace": "^1.0.1",
     "grunt-svgmin": "^0.4.0",
     "grunt-usemin": "^2.1.1",
     "grunt-wiredep": "~2.0.0",