Browse Source

Merge branch 'master' of ssh://10.10.100.21/source/platform-bi-web

zhuth 7 years ago
parent
commit
0f2d7eb252
5 changed files with 7 additions and 11 deletions
  1. 3 4
      Dockerfile
  2. 3 2
      Jenkinsfile
  3. 1 5
      default
  4. 0 0
      jenkins/scripts/deliver.sh
  5. 0 0
      jenkins/scripts/kill.sh

+ 3 - 4
Dockerfile

@@ -9,7 +9,6 @@ FROM ubuntu
 # MAINTAINER name Chunteng Xiao
 RUN apt-get update
 RUN apt-get install -y nodejs nginx npm
-RUN rm -v /etc/nginx/nginx.conf
-ADD nginx.conf /etc/nginx
-EXPOSE 80
-CMD service nginx start
+RUN npm install -g cnpm --registry=https://registry.npm.taobao.org
+ADD default /etc/nginx/sites-available
+EXPOSE 80

+ 3 - 2
Jenkinsfile

@@ -14,9 +14,10 @@ pipeline {
         }
         stage('Deliver'){
             steps {
-                sh './jenkins/scripts/deliver.sh'
+                sh 'npm run build'
+                sh 'echo $! > .pidfile'
+                sh 'service nginx start'
                 input message: 'Finished using the web site? (Click "Proceed" to continue)'
-                sh './jenkins/scripts/kill.sh'
             }
         }
             

+ 1 - 5
nginx.conf → default

@@ -1,13 +1,9 @@
-worker_processes 1;
-event { worker_connections 1024 };
-http {
 server {
 	listen 80;
 	server_name 192.168.253.189;
 	access_log /var/log/nginx/fuck.log;
-	root /usr/bi-web;
+	root /var/jenkins_home/workspace/bi-web/dist;
 	index index.html index.htm;
 	location / {
 	}
 }
-}

+ 0 - 0
Jenkins/scripts/deliver.sh → jenkins/scripts/deliver.sh


+ 0 - 0
Jenkins/scripts/kill.sh → jenkins/scripts/kill.sh