From 6f2ccc32c6b63988b3aeb14f6c72ed2804810988 Mon Sep 17 00:00:00 2001 From: Honza Pokorny Date: Thu, 2 Feb 2017 10:12:11 -0400 Subject: [PATCH] Remove dist/ directory * Move dist/index.html to src/ * Move dist/tripleo_ui_config.js.samle to config/ * Use html webpack plugin to generate dist/index.html on build * Update documentation Reasons: * The dist/ dir conflicts with Python builds in CI * Semantically, having the two files in that directory doesn't make sense Closes-bug: 1661261 Change-Id: I0904e9e5c2ced12865611fab21ee1f66d33d52bb --- {dist => config}/tripleo_ui_config.js.sample | 0 docs/installation.rst | 16 +++++++++++----- {dist => src}/index.html | 1 - webpack.config.js | 6 ++++++ 4 files changed, 17 insertions(+), 6 deletions(-) rename {dist => config}/tripleo_ui_config.js.sample (100%) rename {dist => src}/index.html (89%) diff --git a/dist/tripleo_ui_config.js.sample b/config/tripleo_ui_config.js.sample similarity index 100% rename from dist/tripleo_ui_config.js.sample rename to config/tripleo_ui_config.js.sample diff --git a/docs/installation.rst b/docs/installation.rst index 71b26b53..13978b11 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -104,11 +104,17 @@ Optionally start Karma to run tests after every change: npm run test:watch -Copy ``dist/tripleo_ui_config.js.sample`` to ``dist/tripleo_ui_config.js``, -uncomment the lines pertaining to OpenStack services (``keystone``, ``tripleo``, -etc), and add the urls where these services can be accessed (in this case, the -IP address of the virt host). You can set values for the other services as well -to override the values coming from the keystone serviceCatalog. +Create the ``dist/`` directory, and copy ``config/tripleo_ui_config.js.sample`` +to ``dist/tripleo_ui_config.js``. Uncomment the lines pertaining to OpenStack +services (``keystone``, ``tripleo``, etc), and add the urls where these services +can be accessed (in this case, the IP address of the virt host). You can set +values for the other services as well to override the values coming from the +keystone serviceCatalog. + +:: + + mkdir dist + cp config/tripleo_ui_config.js.sample dist/tripleo_ui_config.js To access the UI, navigate to ``http://localhost:3000/`` diff --git a/dist/index.html b/src/index.html similarity index 89% rename from dist/index.html rename to src/index.html index 45c73a02..5ee9ba22 100644 --- a/dist/index.html +++ b/src/index.html @@ -9,6 +9,5 @@
- diff --git a/webpack.config.js b/webpack.config.js index 8affff1d..b7edfa4b 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,4 +1,5 @@ require('es6-promise').polyfill(); // https://github.com/webpack/css-loader/issues/144 +var HtmlWebpackPlugin = require('html-webpack-plugin'); module.exports = { devtool: 'inline-source-map', @@ -9,6 +10,11 @@ module.exports = { filename: 'tripleo_ui.js', sourceMapFilename: 'tripleo_ui.js.map' }, + plugins: [ + new HtmlWebpackPlugin({ + template: 'src/index.html' + }) + ], module: { loaders: [ // Javascript