Browse Source

fix: 测试构建脚本

master
niushuai233 2 years ago
parent
commit
13ab447a84
  1. 17
      .drone.yml
  2. 2
      deploy.sh

17
.drone.yml

@ -19,9 +19,9 @@ volumes: @@ -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: @@ -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

2
deploy.sh

@ -6,7 +6,7 @@ d_app_version=latest @@ -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"

Loading…
Cancel
Save