Repository: zeppelin Updated Branches: refs/heads/branch-0.7 7db0b6757 -> d0b4287d5
[ZEPPELIN-2154] Support zeppelin.server.port in dev mode (branch-0.7) ### What is this PR for? If user change `zeppelin.server.port` variable in zeppelin-site.xml, zeppelin doesn't work in web development on `branch-0.7` #2097 PR which is same issue on master branch was already merged to master branch. ### What type of PR is it? [Bug Fix | Improvement | Documentation (README.md)] ### What is the Jira issue? * [ZEPPELIN-2154](https://issues.apache.org/jira/browse/ZEPPELIN-2154) ### How should this be tested? 1. Change `zeppelin.server.port` from 8080 to 8888 (or another port) in `zeppelin-site.xml` 2. Run zeppelin (`bin/zeppelin-daemon.sh start`) 3. Run web development mode under zeppelin-web folder such like `SERVER_PORT=8888 yarn run dev` 4. Connect localhost:9000 ### Screenshots (if appropriate) **[Before]**  **[After]**   ### Questions: * Does the licenses files need update? No * Is there breaking changes for older versions? No * Does thi`sneeds documentation? Yes, `README.md` Author: soralee <sora0...@zepl.com> Closes #2124 from soralee/ZEPPELIN-2154_0.7_server_port and squashes the following commits: 8633842 [soralee] [ZEPPELIN-2154] Support zeppelin.server.port in dev mode (branch-0.7) Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/d0b4287d Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/d0b4287d Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/d0b4287d Branch: refs/heads/branch-0.7 Commit: d0b4287d545d1e1f18b7b289ae995fbcbdd433f9 Parents: 7db0b67 Author: soralee <sora0...@zepl.com> Authored: Sun Mar 12 16:24:12 2017 +0900 Committer: ahyoungryu <ahyoung...@apache.org> Committed: Sat Apr 8 13:36:51 2017 +0900 ---------------------------------------------------------------------- zeppelin-web/README.md | 3 +++ zeppelin-web/src/components/baseUrl/baseUrl.service.js | 4 ++-- zeppelin-web/webpack.config.js | 9 ++++++++- 3 files changed, 13 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/zeppelin/blob/d0b4287d/zeppelin-web/README.md ---------------------------------------------------------------------- diff --git a/zeppelin-web/README.md b/zeppelin-web/README.md index bb9cd18..11c26c5 100644 --- a/zeppelin-web/README.md +++ b/zeppelin-web/README.md @@ -31,6 +31,9 @@ $ yarn run build # you need to run zeppelin backend instance also $ yarn run dev +# If you are using a custom port, you must use the 'SERVER_PORT' variable to run the web application development mode +$ SERVER_PORT=8080 yarn run dev + # execute tests $ yarn run test ``` http://git-wip-us.apache.org/repos/asf/zeppelin/blob/d0b4287d/zeppelin-web/src/components/baseUrl/baseUrl.service.js ---------------------------------------------------------------------- diff --git a/zeppelin-web/src/components/baseUrl/baseUrl.service.js b/zeppelin-web/src/components/baseUrl/baseUrl.service.js index ff5e11b..f901157 100644 --- a/zeppelin-web/src/components/baseUrl/baseUrl.service.js +++ b/zeppelin-web/src/components/baseUrl/baseUrl.service.js @@ -24,8 +24,8 @@ function baseUrlSrv() { } } //Exception for when running locally via grunt - if (port === 3333 || port === 9000) { - port = 8080; + if (port === 9000) { + port = process.env.SERVER_PORT; } return port; }; http://git-wip-us.apache.org/repos/asf/zeppelin/blob/d0b4287d/zeppelin-web/webpack.config.js ---------------------------------------------------------------------- diff --git a/zeppelin-web/webpack.config.js b/zeppelin-web/webpack.config.js index d3a2681..84dfbe4 100644 --- a/zeppelin-web/webpack.config.js +++ b/zeppelin-web/webpack.config.js @@ -86,6 +86,12 @@ module.exports = function makeWebpackConfig () { app: './src/index.js' }; + var serverPort = 8080; + + if(process.env.SERVER_PORT) { + serverPort = process.env.SERVER_PORT; + } + /** * Output * Reference: http://webpack.github.io/docs/configuration.html#output @@ -210,7 +216,8 @@ module.exports = function makeWebpackConfig () { // Reference: https://webpack.github.io/docs/list-of-plugins.html#defineplugin new webpack.DefinePlugin({ 'process.env': { - HELIUM_VIS_DEV: process.env.HELIUM_VIS_DEV + HELIUM_VIS_DEV: process.env.HELIUM_VIS_DEV, + SERVER_PORT: serverPort } }) )