From be8894ab82995d35bb18c72ba9c8caab9a71359a Mon Sep 17 00:00:00 2001 From: loser <1711788888@qq.com> Date: Tue, 10 Jan 2023 11:55:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9ECICD=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.yml | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..d3e1522 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,50 @@ +kind: pipeline +type: docker +name: build +trigger: + event: [ push ] + branch: [ master ] +volumes: + - name: node_modules + host: + # 宿主机的绝对路径 + path: /tmp/drone/cache/node_modules +steps: + - name: build-project + image: node:16.15.1 + volumes: + - name: node_modules + path: /drone/src/node_modules + commands: + - pwd + - ls -alt + - npm config set registry https://registry.npm.taobao.org # 切换淘宝镜像 + - npm install + - npm run build + when: + event: push + - name: deploy-project + image: appleboy/drone-scp + settings: + host: 1.117.68.37 + username: root + password: + from_secret: jxb_server_pwd + port: 22 + target: /www/wwwroot/jxb.admin.guwengkj.com #宿主机绝对路径 + source: ./dist/* + script: + - rm -rf /www/wwwroot/jxb.admin.guwengkj.com/dist/ + when: + event: push + - name: notify + pull: if-not-exists + image: guoxudongdocker/drone-dingtalk:latest + settings: + token: 9ad4ebd689e7833204dddfbc67435bc4fe82ab934614ea63a9b9fe4b6e206576 + type: markdown + message_color: true + message_pic: true + sha_link: true + when: + status: [ failure, success ]