summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuangrongFu <fu.guangrong@zte.com.cn>2018-07-23 16:47:42 +0800
committerGuangrongFu <fu.guangrong@zte.com.cn>2018-07-23 16:47:42 +0800
commit7c10ad301cd3fea79af61f1d092b2a3103f7ec11 (patch)
treeabacc5fe0f43906b42b7c061eb4c2dc919d5566b
parenta966da9a6108017711152fc69725397c8779fd08 (diff)
Added nginx
Change-Id: Iffc0e337cbf59f9cae514d85eb3e1c83d0f664f9 Issue-ID: HOLMES-111 Signed-off-by: GuangrongFu <fu.guangrong@zte.com.cn>
-rw-r--r--rulemgt-frontend/.angular-cli.json16
-rw-r--r--rulemgt-frontend/package.json4
-rw-r--r--rulemgt-frontend/src/app/correlation-ruleInfo/ruleInfo.component.ts1
-rw-r--r--rulemgt-frontend/src/index.html2
-rw-r--r--rulemgt-standalone/pom.xml20
-rw-r--r--rulemgt-standalone/src/main/assembly/Dockerfile19
-rw-r--r--rulemgt-standalone/src/main/assembly/bin/run.sh3
-rw-r--r--rulemgt-standalone/src/main/assembly/holmes.nginx.conf43
8 files changed, 97 insertions, 11 deletions
diff --git a/rulemgt-frontend/.angular-cli.json b/rulemgt-frontend/.angular-cli.json
index 67cb647..b3795c9 100644
--- a/rulemgt-frontend/.angular-cli.json
+++ b/rulemgt-frontend/.angular-cli.json
@@ -20,14 +20,18 @@
"prefix": "app",
"styles": [
"styles.css",
- "./assets/common/css/fileupload.css",
- "./assets/common/css/popModal.css",
- "./assets/framework/browser/css/open-ostyle.css",
- "./assets/framework/browser/thirdparty/css/bootstrap.min.css",
- "./assets/framework/browser/thirdparty/css/magic-check.css"
+ "assets/common/css/fileupload.css",
+ "assets/common/css/popModal.css",
+ "assets/framework/browser/css/open-ostyle.css",
+ "assets/framework/browser/thirdparty/css/bootstrap.min.css",
+ "assets/framework/browser/thirdparty/css/magic-check.css"
],
"scripts": [
- "../node_modules/jquery/dist/jquery.min.js"
+ "../node_modules/jquery/dist/jquery.min.js",
+ "assets/common/js/jQuery-File-Upload/js/jquery.ui.widget.js",
+ "assets/common/js/jQuery-File-Upload/js/vendor/jquery.ui.widget.js",
+ "assets/common/js/jQuery-File-Upload/js/jquery.iframe-transport.js",
+ "assets/common/js/jQuery-File-Upload/js/jquery.fileupload.js"
],
"environmentSource": "environments/environment.ts",
"environments": {
diff --git a/rulemgt-frontend/package.json b/rulemgt-frontend/package.json
index 6ba05bf..307bbfa 100644
--- a/rulemgt-frontend/package.json
+++ b/rulemgt-frontend/package.json
@@ -1,7 +1,7 @@
{
- "name": "alarm-analysis",
+ "name": "holmes",
"version": "1.0.0",
- "description": "alarm-analysis",
+ "description": "holmes",
"scripts": {
"ng": "ng",
"start": "ng serve",
diff --git a/rulemgt-frontend/src/app/correlation-ruleInfo/ruleInfo.component.ts b/rulemgt-frontend/src/app/correlation-ruleInfo/ruleInfo.component.ts
index 7f8d375..36d721c 100644
--- a/rulemgt-frontend/src/app/correlation-ruleInfo/ruleInfo.component.ts
+++ b/rulemgt-frontend/src/app/correlation-ruleInfo/ruleInfo.component.ts
@@ -38,7 +38,6 @@ export class RuleInfo implements OnInit {
let msg = { title: 'exception_content_error', message: 'exception_package_error' };
this.modalService.getmodalObservable.next(msg);
} else {
-
this.alarmRuleService.checkContent(this.queryRule.content)
.then(res => {
if (res.status == 200) {
diff --git a/rulemgt-frontend/src/index.html b/rulemgt-frontend/src/index.html
index c8da64f..269bee8 100644
--- a/rulemgt-frontend/src/index.html
+++ b/rulemgt-frontend/src/index.html
@@ -17,7 +17,7 @@
<html>
<head>
- <base href="/">
+ <base href="/holmes/">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
diff --git a/rulemgt-standalone/pom.xml b/rulemgt-standalone/pom.xml
index 6fc8a98..44c7245 100644
--- a/rulemgt-standalone/pom.xml
+++ b/rulemgt-standalone/pom.xml
@@ -117,6 +117,26 @@
<overwrite>true</overwrite>
</configuration>
</execution>
+ <execution>
+ <id>copy-nginx-conf-file</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>target/version</outputDirectory>
+ <resources>
+ <resource>
+ <directory>src/main/assembly/</directory>
+ <filtering>false</filtering>
+ <includes>
+ <include>holmes.nginx.conf</include>
+ </includes>
+ </resource>
+ </resources>
+ <overwrite>true</overwrite>
+ </configuration>
+ </execution>
</executions>
</plugin>
<plugin>
diff --git a/rulemgt-standalone/src/main/assembly/Dockerfile b/rulemgt-standalone/src/main/assembly/Dockerfile
index 457f4ab..d069616 100644
--- a/rulemgt-standalone/src/main/assembly/Dockerfile
+++ b/rulemgt-standalone/src/main/assembly/Dockerfile
@@ -2,7 +2,7 @@ FROM ubuntu:16.04
MAINTAINER "Guangrong Fu" <fu.guangrong@zte.com.cn>
-EXPOSE 9101
+EXPOSE 9101 9104
#install openjdk-1.8
#RUN sed -i 's#http://archive.ubuntu.com#http://mirrors.163.com#g' /etc/apt/sources.list
@@ -16,6 +16,23 @@ ENV PATH $PATH:/usr/lib/jvm/java-8-openjdk-amd64/jre/bin:/usr/lib/jvm/java-8-ope
ENV CLASSPATH .:${JAVA_HOME}/lib:${JRE_HOME}/lib
ENV JRE_HOME ${JAVA_HOME}/jre
+#install neccessary tools
+RUN apt-get install -y bash curl vim
+
+#install nginx
+RUN apt-get install -y wget build-essential libtool libpcre3 libpcre3-dev zlib1g-dev openssl
+RUN wget http://nginx.org/download/nginx-1.14.0.tar.gz
+RUN tar -zxvf nginx-1.14.0.tar.gz
+RUN rm nginx-1.14.0.tar.gz
+WORKDIR /nginx-1.14.0
+RUN ./configure --prefix=/usr/local/nginx
+RUN make install
+RUN ln -s /usr/local/nginx/sbin/nginx /usr/bin/nginx
+RUN rm -rf /nginx-1.14.0
+ADD holmes-rulemgt-frontend-*.tar.gz /usr/local/nginx/html
+ADD holmes.nginx.conf /usr/local/nginx/conf
+
+
ENV HOSTNAME holmes-rule-mgmt
#add holmes related resources to the docker image
diff --git a/rulemgt-standalone/src/main/assembly/bin/run.sh b/rulemgt-standalone/src/main/assembly/bin/run.sh
index 8d52c04..c8bae4c 100644
--- a/rulemgt-standalone/src/main/assembly/bin/run.sh
+++ b/rulemgt-standalone/src/main/assembly/bin/run.sh
@@ -80,4 +80,7 @@ sed -i "s|keyStorePassword:.*|keyStorePassword: $KEY_PASSWORD|" "$main_path/conf
./bin/initDB.sh $JDBC_USERNAME $JDBC_PASSWORD $DB_NAME $DB_PORT "${URL_JDBC%:*}"
+#Start nginx
+nginx -c /usr/local/nginx/conf/holmes.nginx.conf
+
"$JAVA" $JAVA_OPTS -classpath "$class_path" org.onap.holmes.rulemgt.RuleActiveApp server "$main_path/conf/rulemgt.yml"
diff --git a/rulemgt-standalone/src/main/assembly/holmes.nginx.conf b/rulemgt-standalone/src/main/assembly/holmes.nginx.conf
new file mode 100644
index 0000000..575b5a2
--- /dev/null
+++ b/rulemgt-standalone/src/main/assembly/holmes.nginx.conf
@@ -0,0 +1,43 @@
+#user nobody;
+worker_processes 1;
+
+error_log logs/error.log;
+error_log logs/error.log notice;
+error_log logs/error.log info;
+
+pid logs/nginx.pid;
+
+
+events {
+ worker_connections 1024;
+}
+
+
+http {
+ include mime.types;
+ default_type application/octet-stream;
+
+ log_format main '$remote_addr - $remote_user [$time_local] "$request" '
+ '$status $body_bytes_sent "$http_referer" '
+ '"$http_user_agent" "$http_x_forwarded_for"';
+
+ #access_log logs/access.log main;
+
+ sendfile on;
+
+ keepalive_timeout 65;
+
+ server {
+ listen 9104;
+ server_name localhost;
+
+ location / {
+ root html;
+ }
+
+ location ~*.(htm|html){
+ add_header Cache-Control no-cache;
+ root html;
+ }
+ }
+}