Browse Source

修改发布脚本配置

yangc 7 years ago
parent
commit
9b0897d217
3 changed files with 24 additions and 6 deletions
  1. 6 5
      Dockerfile
  2. 2 1
      package.json
  3. 16 0
      post.sh

+ 6 - 5
Dockerfile

@@ -1,13 +1,14 @@
-FROM 10.10.100.200:5000/node-webpack:0.0.1
+FROM nginx
 
 RUN mkdir -p /app
 WORKDIR /app
 
-COPY . /app
+RUN cnpm install
 
-RUN chmod +x run.sh
+RUN npm run build
 
-RUN cnpm install
-#RUN npm run build
+COPY . /app
+
+RUN chmod +x /app/run.sh
 
 CMD [ "/app/run.sh" ]

+ 2 - 1
package.json

@@ -29,7 +29,8 @@
     "start": "cross-env NODE_ENV=production node server.js",
     "generate": "cross-env NODE_ENV=production nuxt generate",
     "lint": "eslint --ext .js,.vue --ignore-path .gitignore .",
-    "precommit": "npm run lint"
+    "precommit": "npm run lint",
+    "zip": "node build/zip.js"
   },
   "devDependencies": {
     "babel-cli": "^6.24.1",

+ 16 - 0
post.sh

@@ -0,0 +1,16 @@
+#!/bin/sh
+
+groupId=com.uas.platform
+artifactId=mall-ssr
+packaging=zip
+version=1.0.0
+repo_uri='http://10.10.100.23:23004/v1/artifact'
+
+basepath=$(cd `dirname $0`; pwd)
+buildfile=$basepath/dist.zip
+
+cnpm install
+npm run build
+npm run zip
+curl -H "Expect:" -F "groupId=$groupId" -F "artifactId=$artifactId" -F "packaging=$packaging"  -F "version=$version" -F "file=@$buildfile" $repo_uri
+rm -rf $buildfile