Portal Build Instructions
This page describes how to build the ONAP Portal webapp and the ONAP Portal SDK webapp, and how to deploy webapps to a web server.
It does not cover the process of configuring a virtual machine from scratch.
Required Tools
The computer must have the following software packages installed:
Java
Maven (3.3.3+) currently 3.5.0
nodejs version >=4.x.x; download from https://nodejs.org/
node-gyp with all its requirements (e.g., Python v.2.7.x, GCC, …) as listed at https://github.com/nodejs/node-gyp
grunt-cli installed globally, download from https://github.com/gruntjs/grunt-cli
To install: npm install -g grunt-cli
bower from http://bower.io/
To install: npm install -g bower
Install 3rd Party Packages
In your git working copy, go to the directory ecomp-portal-FE
Clean out the npm cache by running this command:
npm cache cleanInstall all node and grunt dependencies listed in the package.json file by running this command:
npm installInstall all client dependencies listed in the bower.json file by running this command:
bower install
Get the Code
Clone the ecomp portal core repository from Gerri. The URL is something like this (replace 'your_id' of course):
git clone http://gerrit.onap.org/r/portal
This should create a new folder with subfolders, some for the back-end web server components and others for the front-end pages and scripts:
Build and Deploy the ONAP Portal FE+BE Distribution
After all of the above steps have been performed successfully, use the following procedure to build and deploy the front-end and back-end
distributions to a web server.
Build the FE distribution
In your git working copy, go to the directory ecomp-portal-FE and build the distribution by typing this command:
grunt build --env=dev
Note that the "dev" argument here relies on the file ecomp-portal-FE-os/client/configurations/dev.json, which defines all API endpoints for this build. You can duplicate this file, modify the endpoints and call it whatever you like.
Build the BE distribution
In your git working copy, go to the root directory and build the distribution by typing this command:
mvn clean package
Configure the FE distribution
Before you build, configure your destination environment so the JavaScript minimization creates the correct back end (BE). This configuration is done in ecomp-portal-FE-os/client/configuration/dev.json (or any other file you want). For example:
{
"api": {
"userApps": "https://<yourHost>/ecomp_portal/api/userApps",
"accountAdmins": "https://<yourHost>/ecomp_portal/api/accountAdmins",
"availableApps": "https://<yourHost>/ecomp_portal/api/availableApps",
"userProfile": "https://<yourHost>/ecomp_portal/api/userProfile",
"queryUsers": "https://<yourHost>/ecomp_portal/api/queryUsers",
"adminAppsRoles": "https://<yourHost>/ecomp_portal/api/adminAppsRoles"
}
}
Also, copy the bower_components folder from ecomp-portal-FE-os to the folder ecomp-portal-FE-os/client then build as shown above:
grunt build --env=dev
This step will populate the folder ecomp-portal-FE-os/dist with a folder named public. Copy that public folder from comp-portal-FE-os/dist/ to the folder ecomp-portal-BE-os/target/ecompportal/ .
Deploy the ONAP Portal Web Application
Now upload the contents of the folder ecomp-portal-BE-os/target/ecompportal to the web server host, for example on <yourHost>, to /<yourHost>/WebApps/dev/ECOMP_PORTAL/ecomp_portal .
Note the difference between ‘ecomp_portal’ and ‘ecompportal’! The final URL should have the context name ecomp_portal with an underscore.
Restart tomcat and visit the appropriate page; e.g., https://<yourHost>:8989/ECOMPPORTAL/login.htm