Add install instructions to README
Describe the different options for hosting the web application. Change-Id: I6c4fc46761d578271317bcbd7be7250d24f26567
This commit is contained in:
parent
f4dc1e52ab
commit
c938dc9817
92
README.md
92
README.md
|
@ -1,4 +1,5 @@
|
|||
# ironic-webclient
|
||||
|
||||
A webclient for OpenStack Ironic.
|
||||
|
||||
|
||||
|
@ -9,7 +10,7 @@ easy to package for various linux distributions. As such, the following
|
|||
decisions have been made:
|
||||
|
||||
|
||||
##### The project must be fully functional directly from source.
|
||||
##### The project must be fully functional directly from source.
|
||||
|
||||
* ECMAScript 5 only, no transpiled languages such as TypeScript or
|
||||
CoffeeScript.
|
||||
|
@ -22,6 +23,7 @@ performance of this application.
|
|||
|
||||
|
||||
##### The project must be easy to develop on.
|
||||
|
||||
* We use common javascript tooling to assist in development (npm, gulp,
|
||||
eslint, bower, etc).
|
||||
* These tools are supportive, but not required, as such they are considered to
|
||||
|
@ -29,27 +31,85 @@ performance of this application.
|
|||
|
||||
|
||||
##### The project must be compatible with the OpenStack License.
|
||||
|
||||
* All runtime dependencies and development tools must use licenses compatible
|
||||
with the Apache2.0 license.
|
||||
|
||||
|
||||
## Development Server
|
||||
## Installation
|
||||
|
||||
1. Check out the code.
|
||||
2. Run `npm install`
|
||||
1. Realize that you don't have node installed. Install node, and npm.
|
||||
2. If using a Debian/Ubuntu system, also install node.js and nodejs-legacy.
|
||||
3. Then try again.
|
||||
3. Run `npm start`
|
||||
You will need Node.JS and NPM installed on the target system. For Fedora and/or
|
||||
CentOS systemd you can install these as follows:
|
||||
|
||||
```
|
||||
$ yum install -y nodejs npm #dnf on Fedora
|
||||
```
|
||||
|
||||
and on Debian/Ubuntu with:
|
||||
|
||||
```
|
||||
$ apt-get install nodejs nodejs-legacy npm
|
||||
```
|
||||
|
||||
To install the webclient you have to check out the code and install the
|
||||
dependencies. This can be done as follows:
|
||||
|
||||
```
|
||||
$ git clone https://github.com/openstack/ironic-webclient.git
|
||||
$ cd ironic-webclient
|
||||
$ npm install
|
||||
```
|
||||
|
||||
|
||||
### Enable CORS
|
||||
|
||||
To be able to access the Ironic API, you have to enable CORS. A description for
|
||||
this can be found in the chapter [Cross-origin resource sharing](http://docs.openstack.org/admin-guide/cross_project_cors.html)
|
||||
of the OpenStack Administrator's Guide.
|
||||
|
||||
|
||||
### Hosting
|
||||
|
||||
After installing the dependencies and enabling CORS, you have two options of
|
||||
running the web application; using the development server or hosted using
|
||||
a webserver.
|
||||
|
||||
|
||||
#### Development Server
|
||||
|
||||
The webclient offers a built-in webserver option for development purpose. It is
|
||||
not recommended to use this in production use. You can start this server with:
|
||||
|
||||
```
|
||||
$ npm start
|
||||
```
|
||||
|
||||
Which will start the server on [localhost, port 8000](http://localhost:8000).
|
||||
|
||||
If you want to run on a different port or IP, you can specify this from the
|
||||
command line as follows:
|
||||
|
||||
```
|
||||
IP=0.0.0.0 PORT=8080 npm start
|
||||
```
|
||||
|
||||
|
||||
#### Webserver
|
||||
|
||||
For production use, it is recommended to use a webserver. After running
|
||||
|
||||
```
|
||||
$ npm pack
|
||||
```
|
||||
|
||||
you will have a package which will contain all assets needed for hosting the
|
||||
application.
|
||||
|
||||
|
||||
## Other options
|
||||
|
||||
// Will resolve all the runtime dependencies. Remember to commit them.
|
||||
npm run update_dependencies
|
||||
|
||||
// Will package the site.
|
||||
npm pack
|
||||
|
||||
// Will spin up a local server and host the raw, unpackaged application.
|
||||
npm start
|
||||
* Package the site.
|
||||
|
||||
```
|
||||
npm pack
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue