Added nginx 31/57131/1
authorGuangrongFu <fu.guangrong@zte.com.cn>
Mon, 23 Jul 2018 08:47:42 +0000 (16:47 +0800)
committerGuangrongFu <fu.guangrong@zte.com.cn>
Mon, 23 Jul 2018 08:47:42 +0000 (16:47 +0800)
Change-Id: Iffc0e337cbf59f9cae514d85eb3e1c83d0f664f9
Issue-ID: HOLMES-111
Signed-off-by: GuangrongFu <fu.guangrong@zte.com.cn>
rulemgt-frontend/.angular-cli.json
rulemgt-frontend/package.json
rulemgt-frontend/src/app/correlation-ruleInfo/ruleInfo.component.ts
rulemgt-frontend/src/index.html
rulemgt-standalone/pom.xml
rulemgt-standalone/src/main/assembly/Dockerfile
rulemgt-standalone/src/main/assembly/bin/run.sh
rulemgt-standalone/src/main/assembly/holmes.nginx.conf [new file with mode: 0644]

index 67cb647..b3795c9 100644 (file)
       "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": {
index 6ba05bf..307bbfa 100644 (file)
@@ -1,7 +1,7 @@
 {
-  "name": "alarm-analysis",
+  "name": "holmes",
   "version": "1.0.0",
-  "description": "alarm-analysis",
+  "description": "holmes",
   "scripts": {
     "ng": "ng",
     "start": "ng serve",
index 7f8d375..36d721c 100644 (file)
@@ -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) {
index c8da64f..269bee8 100644 (file)
@@ -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">
 
index 6fc8a98..44c7245 100644 (file)
                             <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>
index 457f4ab..d069616 100644 (file)
@@ -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
index 8d52c04..c8bae4c 100644 (file)
@@ -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 (file)
index 0000000..575b5a2
--- /dev/null
@@ -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;
+        }
+    }
+}