From 13ab447a8472232159971ed668c673cbc6439195 Mon Sep 17 00:00:00 2001 From: niushuai233 Date: Fri, 30 Dec 2022 11:57:47 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=B5=8B=E8=AF=95=E6=9E=84=E5=BB=BA?= =?UTF-8?q?=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.yml | 17 +++++++---------- deploy.sh | 2 +- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/.drone.yml b/.drone.yml index cff89fc..0ad2e50 100644 --- a/.drone.yml +++ b/.drone.yml @@ -19,9 +19,9 @@ volumes: - name: node-cache host: path: /data/drone/node/cache - - name: node-build + - name: node-modules host: - path: /data/drone/node/build + path: /data/drone/node/node_modules - name: docker-sock host: path: /var/run/docker.sock @@ -36,19 +36,16 @@ steps: image: node:16.17.0 volumes: - name: node-cache - path: /node_modules - - name: node-build - path: /app/build + path: /node_cache + - name: node-modules + path: /drone/src/node_modules commands: - echo 'node package start' # 打包 - - npm config set cache /node_modules --global - - npm run pre --force + - npm config set cache /node_cache --global + - npm run pre - npm install - npm run build - # 拷贝打包结果到宿主机 - - mkdir -p /app/build/db-bastion-vue - - cp -R dist/ /app/build/db-bastion-vue/ # 构建镜像 - name: build-image diff --git a/deploy.sh b/deploy.sh index 1e68321..f9ad939 100644 --- a/deploy.sh +++ b/deploy.sh @@ -6,7 +6,7 @@ d_app_version=latest d_app_port_inner=80 d_app_port_export=31014 -if [[ -n $(docker ps -q -f "name=^${d_app_name}$") ]];then +if [[ -n $(docker ps -a -q -f "name=^${d_app_name}$") ]];then echo "${d_app_name} already started before ==> rm" docker rm -f ${d_app_name} echo "${d_app_name} rm success"