(Deprecated - Feb 2017 version) - TODO: update
This page describes how to build the OpenECOMP Portal webapp and the OpenECOMP 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 clean - Install all node and grunt dependencies listed in the package.json file by running this command:
npm install - Install all client dependencies listed in the bower.json file by running this command:
bower install
Get the Code
Clone the OpenECOMP repositories from your Git repository and create local tracking branches. The required commands are something like these (replace 'your_id' of course):
git clone https://<your_id>@<yourGitRepositoryHost>/scm/st_quantum/ecomp_portal_core.git -b 1607_master
git clone https://<your_id>@<yourGitRepositoryHost>scm/st_quantum/quantum.git -b BRANCH_1607
This should create two new folders:
- ecomp_portal_core should have these two subfolders (in 1607):
- ecomp-portal-BE - back-end web server components
- ecomp-portal-FE - front-end pages and scripts
- quantum should have these two subfolders (in 1607):
- quantum - core and webapp
- thirdparty - framework for onboarding applications
Unfortunately, the local tracking branches have different names in the two repos.
Build and Deploy the OpenECOMP 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/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 directory ecomp-portal-BE 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/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 to the folder ecomp-portal-FE/client then build as shown above:
grunt build --env=dev
This step will populate the folder ecomp-portal-FE/dist with a folder named public. Copy that public folder from comp-portal-FE/dist/ to the folder ecomp-portal-BE/target/ecomppportal/ .
Deploy the OpenECOMP Portal Web Application
Now upload the contents of the folder ecomp-portal-BE/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>/ecomp_portal/login.html
Script for Building and Deploying
The build-auto.sh script, shown below, automates all the build and deploy steps. To invoke it, make sure you are in the auto-builds directory, and then give the command build-auto.sh:
$ pwd /<yourHost>/WebApps/dev/ECOMPPORTAL/auto-builds $ more build-auto.sh
Here is a listing of build-auto.sh:
$ more build-auto.sh ##### rundate=`date +%G%m%d%H%M%S` cd /<yourHost>/WebApps/dev/ECOMPPORTAL/auto-builds/ rm -rf ecomp_portal_core git clone https://<yourRepositoryHost>/scm/st_quantum/ecomp_portal_core.git -b 1607_Master #git pull cd ecomp_portal_core/ecomp-portal-FE/ export PATH=$PATH:/<yourHost>/WebApps/dev/ECOMPPORTAL/auto-builds/nodejs-installed/node-v5.10.1-linux-x64/bi n:/<yourHost>/WebApps/dev/ECOMPPORTAL/au to-builds/ecomp_portal_core/ecomp-portal-FE/node_modules/grunt-cli/bin:/<yourHost>/WebApps/dev/ECOMPPORTAL/ auto-builds/ecomp_portal_core/ecomp-po rtal-FE/node_modules/bower/bin:/<yourHost>/WebApps/dev/ECOMPPORTAL/apache-maven-3.3.3/bin npm install npm install bower bower install npm install grunt-cli /<yourHost>/WebApps/dev/ECOMPPORTAL/auto-builds/ecomp_portal_core/ecomp-portal-FE/node_modules/grunt-cli/bi n/grunt build --env=integ cp -R dist/public ../ecomp-portal-BE/war/ cd ../ecomp-portal-BE/ cp /<yourHost>/WebApps/dev/ECOMPPOies/system.properties war/WEB-INF/conf/ mvn clean package #shutdown tomcat mv /<yourHost>/WebApps/dev/ECOMPPORTAL/ecompportal /<yourHost>/WebApps/dev/ECOMPPORTAL/ecompportal_$rundate cp -R target/ecompportal /<yourHost>/WebApps/dev/ECOMPPORTAL/