diff options
author | GuangrongFu <fu.guangrong@zte.com.cn> | 2021-03-25 19:47:46 +0800 |
---|---|---|
committer | GuangrongFu <fu.guangrong@zte.com.cn> | 2021-04-13 08:28:01 +0800 |
commit | 634cf1fa05c4a48435eaff66eb8c1040a47055c2 (patch) | |
tree | 9c7ee32bab4332685808b367c067a28f07e1f3de | |
parent | e9b8eb874d364e61711bd01890a519463be1dfe3 (diff) |
Replace the UI Certs
Change-Id: I4012f7f500e37773c1b00516a6495c224789a47e
Issue-ID: HOLMES-428
Signed-off-by: GuangrongFu <fu.guangrong@zte.com.cn>
-rw-r--r-- | pom.xml | 2 | ||||
-rw-r--r-- | rulemgt-frontend/pom.xml | 2 | ||||
-rw-r--r-- | rulemgt-standalone/pom.xml | 2 | ||||
-rw-r--r-- | rulemgt-standalone/src/main/assembly/bin/initDB.sh | 27 | ||||
-rw-r--r-- | rulemgt-standalone/src/main/assembly/bin/run.sh | 4 | ||||
-rw-r--r-- | rulemgt/pom.xml | 2 | ||||
-rw-r--r-- | version.properties | 2 |
7 files changed, 29 insertions, 12 deletions
@@ -25,7 +25,7 @@ <groupId>org.onap.holmes.rule-management</groupId> <artifactId>holmes-rulemgt-parent</artifactId> - <version>1.3.1-SNAPSHOT</version> + <version>1.3.2-SNAPSHOT</version> <packaging>pom</packaging> <name>holmes-rule-management</name> <modules> diff --git a/rulemgt-frontend/pom.xml b/rulemgt-frontend/pom.xml index 98d6473..acf65b2 100644 --- a/rulemgt-frontend/pom.xml +++ b/rulemgt-frontend/pom.xml @@ -24,7 +24,7 @@ <parent> <groupId>org.onap.holmes.rule-management</groupId> <artifactId>holmes-rulemgt-parent</artifactId> - <version>1.3.1-SNAPSHOT</version> + <version>1.3.2-SNAPSHOT</version> </parent> <artifactId>holmes-rulemgt-frontend</artifactId> diff --git a/rulemgt-standalone/pom.xml b/rulemgt-standalone/pom.xml index 6a96cad..d8c3720 100644 --- a/rulemgt-standalone/pom.xml +++ b/rulemgt-standalone/pom.xml @@ -23,7 +23,7 @@ <parent> <groupId>org.onap.holmes.rule-management</groupId> <artifactId>holmes-rulemgt-parent</artifactId> - <version>1.3.1-SNAPSHOT</version> + <version>1.3.2-SNAPSHOT</version> </parent> <artifactId>holmes-rulemgt-standalone</artifactId> diff --git a/rulemgt-standalone/src/main/assembly/bin/initDB.sh b/rulemgt-standalone/src/main/assembly/bin/initDB.sh index 46fb1e6..3da96e9 100644 --- a/rulemgt-standalone/src/main/assembly/bin/initDB.sh +++ b/rulemgt-standalone/src/main/assembly/bin/initDB.sh @@ -25,9 +25,13 @@ host=$5 echo "Initializing the holmes rule management database..." main_path=$HOME/.. -sed -i "s|DBNAME|$dbname|g" "$main_path/dbscripts/postgresql/onap-holmes_rulemgt-createobj.sql" -sed -i "s|DBUSER|$user|g" "$main_path/dbscripts/postgresql/onap-holmes_rulemgt-createobj.sql" -sed -i "s|DBPWD|$password|g" "$main_path/dbscripts/postgresql/onap-holmes_rulemgt-createobj.sql" +if [ -d /opt/hrmconfig ]; then + cp /opt/hrmconfig/onap-holmes_rulemgt-createobj.sql "$main_path/dbscripts/postgresql/onap-holmes_rulemgt-createobj.sql" +else + sed -i "s|DBNAME|$dbname|g" "$main_path/dbscripts/postgresql/onap-holmes_rulemgt-createobj.sql" + sed -i "s|DBUSER|$user|g" "$main_path/dbscripts/postgresql/onap-holmes_rulemgt-createobj.sql" + sed -i "s|DBPWD|$password|g" "$main_path/dbscripts/postgresql/onap-holmes_rulemgt-createobj.sql" +fi cat $main_path/dbscripts/postgresql/onap-holmes_rulemgt-createobj.sql echo "dbname=$dbname" @@ -35,11 +39,20 @@ echo "user=$user" echo "password=$password" echo "port=$port" echo "host=$host" -export PGPASSWORD=$password -psql -U $user -p $port -h $host -d $dbname -f $main_path/dbscripts/postgresql/onap-holmes_rulemgt-createobj.sql -psql -U $user -p $port -h $host -d $dbname --command 'select * from aplus_rule;' + +if [ -z `env | grep PGPASSWORD` ]; then + export PGPASSWORD=$password + need_unset=1 +fi + +psql -U "'$user'" -p "'$port'" -h "'$host'" -d "'$dbname'" -f $main_path/dbscripts/postgresql/onap-holmes_rulemgt-createobj.sql +psql -U "'$user'" -p "'$port'" -h "'$host'" -d "'$dbname'" --command 'select * from aplus_rule;' sql_result=$? -unset PGPASSWORD + +if [ "$need_unset"x == "1"x ]; then + unset PGPASSWORD +fi + echo "sql_result=$sql_result" if [ $sql_result != 0 ] ; then echo "Failed to initialize the database!" diff --git a/rulemgt-standalone/src/main/assembly/bin/run.sh b/rulemgt-standalone/src/main/assembly/bin/run.sh index ff684b9..69b5df5 100644 --- a/rulemgt-standalone/src/main/assembly/bin/run.sh +++ b/rulemgt-standalone/src/main/assembly/bin/run.sh @@ -114,6 +114,10 @@ ${RUNHOME}/initDB.sh $JDBC_USERNAME $JDBC_PASSWORD $DB_NAME $DB_PORT "${URL_JDBC #curl -X POST -H "Content-Type: application/json" -d ${msg_body} http://${MSB_ADDR}/api/msdiscover/v1/services?is_manual=true #echo Registered UI to MSB. +if [ -f "/opt/app/osaaf/local/org.onap.holmes-rule-mgmt.crt" ]; then + sed -i "s|/etc/ssl/certs/holmes-frontend-selfsigned.crt|/opt/app/osaaf/local/org.onap.holmes-rule-mgmt.crt|" "/etc/nginx/conf.d/nginx-https.conf" + sed -i "s|/etc/ssl/private/holmes-frontend.key|/opt/app/osaaf/local/org.onap.holmes-rule-mgmt.key|" "/etc/nginx/conf.d/nginx-https.conf" +fi if [ ${ENABLE_ENCRYPT} = true ]; then nginx -c /etc/nginx/conf.d/nginx-https.conf diff --git a/rulemgt/pom.xml b/rulemgt/pom.xml index 6d9fc2e..facac64 100644 --- a/rulemgt/pom.xml +++ b/rulemgt/pom.xml @@ -20,7 +20,7 @@ <parent> <groupId>org.onap.holmes.rule-management</groupId> <artifactId>holmes-rulemgt-parent</artifactId> - <version>1.3.1-SNAPSHOT</version> + <version>1.3.2-SNAPSHOT</version> </parent> <artifactId>holmes-rulemgt</artifactId> diff --git a/version.properties b/version.properties index fb21064..0969948 100644 --- a/version.properties +++ b/version.properties @@ -4,7 +4,7 @@ major=1 minor=3 -patch=1 +patch=2 base_version=${major}.${minor}.${patch} |