summaryrefslogtreecommitdiffstats
path: root/admportal/shell
diff options
context:
space:
mode:
Diffstat (limited to 'admportal/shell')
-rwxr-xr-xadmportal/shell/getAdmPortalProp.py13
-rwxr-xr-xadmportal/shell/start.sh11
-rwxr-xr-xadmportal/shell/start_netdb.sh12
-rwxr-xr-xadmportal/shell/start_portal.sh32
-rwxr-xr-xadmportal/shell/startssl.sh28
-rw-r--r--admportal/shell/stop.sh2
-rwxr-xr-xadmportal/shell/stopssl.sh13
-rw-r--r--admportal/shell/svclogic.sh32
-rwxr-xr-xadmportal/shell/www14
9 files changed, 157 insertions, 0 deletions
diff --git a/admportal/shell/getAdmPortalProp.py b/admportal/shell/getAdmPortalProp.py
new file mode 100755
index 00000000..2e0ea797
--- /dev/null
+++ b/admportal/shell/getAdmPortalProp.py
@@ -0,0 +1,13 @@
+#!/usr/bin/python
+
+import json
+import sys
+import os
+
+propfile = os.getenv('SDNC_CONFIG_DIR') + '/admportal.json'
+
+from pprint import pprint
+
+with open(propfile) as data_file:
+ data = json.load(data_file)
+pprint( str(data[sys.argv[1]]))
diff --git a/admportal/shell/start.sh b/admportal/shell/start.sh
new file mode 100755
index 00000000..d8cb0fcd
--- /dev/null
+++ b/admportal/shell/start.sh
@@ -0,0 +1,11 @@
+#. ./set-http-env.sh
+#cd ../bin
+#cp ../config/config.json.http ../config/config.json
+. /etc/attappl.env
+. ${PROJECT_HOME}/etc/default.env
+
+MAIN_MENU=`python printMainMenu.py | sed -e 's|['\'']||g'`
+export MAIN_MENU
+
+cd ..
+pm2 startOrRestart process.http.json
diff --git a/admportal/shell/start_netdb.sh b/admportal/shell/start_netdb.sh
new file mode 100755
index 00000000..4a3d75ac
--- /dev/null
+++ b/admportal/shell/start_netdb.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+. /etc/attappl.env
+. ${PROJECT_HOME}/etc/default.env
+. ${PROJECT_HOME}/siteconfig/siteconf.info
+
+# only run on primary adm vm
+# ${Rank} comes from siteconf.info
+if [ ${Rank} == '1' ]; then
+ cd /opt/admportal/server
+ node ./netdb_updater.js -t ${1} -d ${2} >/dev/null 2>&1
+fi
diff --git a/admportal/shell/start_portal.sh b/admportal/shell/start_portal.sh
new file mode 100755
index 00000000..976502cd
--- /dev/null
+++ b/admportal/shell/start_portal.sh
@@ -0,0 +1,32 @@
+#. ./set-https-env.sh
+#cd ../bin
+#cp ../config/config.json.https ../config/config.json
+export PROJECT_HOME=/opt/openecomp/sdnc
+export PROJECT_RUNTIME_BASE=/opt/openecomp/sdnc
+#export JAVA_HOME=/usr/lib/jvm/java-7-oracle
+export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
+export SSL_ENABLED=false
+export SDNC_CONFIG_DIR=${PROJECT_HOME}/data/properties
+export NODE_ENV=production
+export CLASSPATH=$PROJECT_HOME/admportal/lib:$CLASSPATH
+
+PATH=${PATH}:${JAVA_HOME}/bin
+
+#. ${PROJECT_HOME}/etc/default.env
+
+MAIN_MENU=`python $PROJECT_HOME/admportal/shell/getAdmPortalProp.py MainMenu | sed -e 's|['\'']||g'`
+export MAIN_MENU
+SSL_ENABLED=`python $PROJECT_HOME/admportal/shell/getAdmPortalProp.py sslEnabled | sed -e 's|['\'']||g'`
+export SSL_ENABLED
+
+if [ ! -d /opt/openecomp/sdnc/admportal/node_modules ]; then
+ cd /opt/openecomp/sdnc/admportal && npm install
+fi
+
+cd /opt/openecomp/sdnc/admportal
+node shell/www
+#if [ "true" == "${SSL_ENABLED}" ]; then
+ #pm2 startOrRestart process.https.json
+#else
+ #pm2 startOrRestart process.http.json
+#fi
diff --git a/admportal/shell/startssl.sh b/admportal/shell/startssl.sh
new file mode 100755
index 00000000..a56570e3
--- /dev/null
+++ b/admportal/shell/startssl.sh
@@ -0,0 +1,28 @@
+#. ./set-https-env.sh
+#cd ../bin
+#cp ../config/config.json.https ../config/config.json
+export PROJECT_HOME=/opt/openecomp/sdnc
+export PROJECT_RUNTIME_BASE=/opt/openecomp/sdnc
+#export JAVA_HOME=/usr/lib/jvm/java-7-oracle
+export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
+export SSL_ENABLED=false
+export SDNC_CONFIG_DIR=${PROJECT_HOME}/data/properties
+export NODE_ENV=production
+export CLASSPATH=$PROJECT_HOME/admportal/lib:$CLASSPATH
+
+PATH=${PATH}:${JAVA_HOME}/bin
+
+#. ${PROJECT_HOME}/etc/default.env
+
+MAIN_MENU=`python $PROJECT_HOME/admportal/shell/getAdmPortalProp.py MainMenu | sed -e 's|['\'']||g'`
+export MAIN_MENU
+SSL_ENABLED=`python $PROJECT_HOME/admportal/shell/getAdmPortalProp.py sslEnabled | sed -e 's|['\'']||g'`
+export SSL_ENABLED
+
+cd ..
+node bin/www
+#if [ "true" == "${SSL_ENABLED}" ]; then
+ #pm2 startOrRestart process.https.json
+#else
+ #pm2 startOrRestart process.http.json
+#fi
diff --git a/admportal/shell/stop.sh b/admportal/shell/stop.sh
new file mode 100644
index 00000000..404c2fbd
--- /dev/null
+++ b/admportal/shell/stop.sh
@@ -0,0 +1,2 @@
+pm2 stop http_admportal
+pm2 kill
diff --git a/admportal/shell/stopssl.sh b/admportal/shell/stopssl.sh
new file mode 100755
index 00000000..a71de61e
--- /dev/null
+++ b/admportal/shell/stopssl.sh
@@ -0,0 +1,13 @@
+. /etc/attappl.env
+. ${PROJECT_HOME}/etc/default.env
+
+SSL_ENABLED=`python /opt/admportal/shell/getAdmPortalProp.py sslEnabled | sed -e 's|['\'']||g'`
+export SSL_ENABLED
+
+cd ..
+if [ "true" == "${SSL_ENABLED}" ]; then
+ pm2 stop admportal8443
+else
+ pm2 stop http_admportal
+fi
+pm2 kill
diff --git a/admportal/shell/svclogic.sh b/admportal/shell/svclogic.sh
new file mode 100644
index 00000000..aca6bf1f
--- /dev/null
+++ b/admportal/shell/svclogic.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+###
+# ============LICENSE_START=======================================================
+# openECOMP : SDN-C
+# ================================================================================
+# Copyright (C) 2017 AT&T Intellectual Property. All rights
+# reserved.
+# ================================================================================
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ============LICENSE_END=========================================================
+###
+
+BASEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
+JARDIR=${BASEDIR}/lib
+
+for jar in $JARDIR/*.jar
+do
+ CLASSPATH=$CLASSPATH:${jar}
+done
+
+java -cp ${CLASSPATH}:${MYSQL_JDBC_DRIVER} org.openecomp.sdnc.sli.SvcLogicParser $*
diff --git a/admportal/shell/www b/admportal/shell/www
new file mode 100755
index 00000000..29710dbb
--- /dev/null
+++ b/admportal/shell/www
@@ -0,0 +1,14 @@
+#!/usr/bin/env node
+var debug = require('debug')('admportal');
+var app = require('../server/app');
+var properties = require(process.env.SDNC_CONFIG_DIR + '/admportal.json');
+var out_file = "/opt/openecomp/sdnc/admportal/logs/http_admportal.log";
+var error_file = "/opt/openecomp/sdnc/admportal/logs/error_http_admportal.log";
+var cwd = "/opt/openecomp/sdnc/admportal";
+
+app.set('port', properties.nonSslPort || 8181 );
+
+var server = app.listen(app.get('port'), function() {
+ console.log('Express server listening on port ' + server.address().port);
+ debug('Express server listening on port ' + server.address().port);
+});