Browse Source

fix: 调整ci脚本

master
niushuai233 2 years ago
parent
commit
11a73bbb95
  1. 62
      .drone.yml

62
.drone.yml

@ -28,7 +28,9 @@ volumes: @@ -28,7 +28,9 @@ volumes:
- name: env-files
host:
path: /niushuai233/env
- name: nginx-www
host:
path: /usr/share/nginx/www
# ci 步骤
steps:
# node install
@ -42,41 +44,41 @@ steps: @@ -42,41 +44,41 @@ steps:
path: /node_cache
- name: node-modules
path: /drone/src/node_modules
- name: nginx-www
path: /dist
commands:
- echo 'node package start'
- ls -alh
- echo $PROD_API_URL
- sed -i "s#PROD_API_URL#$PROD_API_URL#g" .env.production
- cat .env.production
# 打包
- npm config set registry https://registry.npm.taobao.org
- npm config set cache /node_cache --global
- npm run pre
- npm run build
- mkdir -p /dist/db-bastion-vue/
- cp -R dist/* /dist/db-bastion-vue/
# 构建镜像
- name: build-image
image: docker:dind
volumes:
- name: docker-sock
path: /var/run/docker.sock
commands:
- echo 'build image start'
# 构建新镜像
- docker build -t niushuai233/db-bastion-vue:latest .
# 清理无用镜像
- docker image prune -f --filter "dangling=true"
# # 构建镜像
# - name: build-image
# image: docker:dind
# volumes:
# - name: docker-sock
# path: /var/run/docker.sock
# commands:
# - echo 'build image start'
# # 构建新镜像
# - docker build -t niushuai233/db-bastion-vue:latest .
# # 清理无用镜像
# - docker image prune -f --filter "dangling=true"
# 启动服务
- name: deploy
image: docker:dind
volumes:
- name: docker-sock
path: /var/run/docker.sock
- name: env-files
path: /niushuai233/env
commands:
- echo 'deploy start'
- pwd
- ls -alh
- sh deploy.sh
# # 启动服务
# - name: deploy
# image: docker:dind
# volumes:
# - name: docker-sock
# path: /var/run/docker.sock
# - name: env-files
# path: /niushuai233/env
# commands:
# - echo 'deploy start'
# - pwd
# - ls -alh
# - sh deploy.sh
Loading…
Cancel
Save