From c2b54c15e668c23ff3bb91a49b274fbc6ed79892 Mon Sep 17 00:00:00 2001 From: mozzie Date: Thu, 23 Mar 2023 13:54:35 +0800 Subject: [PATCH 1/4] =?UTF-8?q?cd:=20=E4=BF=AE=E6=94=B9drone=20build?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.drone.yml b/.drone.yml index 0a31078..8547423 100644 --- a/.drone.yml +++ b/.drone.yml @@ -8,6 +8,12 @@ volumes: host: path: /home/drone/cache/node_modules +when: + branch: + - release/** + event: + - push + steps: # web端 - name: build-web From 98ace645f5706bb84504a35415cca8c4b10754d7 Mon Sep 17 00:00:00 2001 From: mozzie Date: Thu, 23 Mar 2023 13:56:08 +0800 Subject: [PATCH 2/4] =?UTF-8?q?cd:=20=E4=BF=AE=E6=94=B9drone=20build?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.drone.yml b/.drone.yml index 8547423..63bb2c2 100644 --- a/.drone.yml +++ b/.drone.yml @@ -8,12 +8,6 @@ volumes: host: path: /home/drone/cache/node_modules -when: - branch: - - release/** - event: - - push - steps: # web端 - name: build-web @@ -70,6 +64,10 @@ steps: target: /www/wwwroot/nginx/html/backset.cn/ source: ./apps/admin/dist/* +when: + branch: + - release/** + --- kind: pipeline type: exec @@ -83,3 +81,7 @@ steps: - name: docker container commands: - docker-compose up -d + +when: + branch: + - release/** From 1d1574edcc1425fd06194e961db763930ab435ba Mon Sep 17 00:00:00 2001 From: mozzie Date: Thu, 23 Mar 2023 13:58:55 +0800 Subject: [PATCH 3/4] =?UTF-8?q?cd:=20=E4=BF=AE=E6=94=B9drone=20build?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index 63bb2c2..939e0c5 100644 --- a/.drone.yml +++ b/.drone.yml @@ -64,7 +64,7 @@ steps: target: /www/wwwroot/nginx/html/backset.cn/ source: ./apps/admin/dist/* -when: +trigger: branch: - release/** @@ -82,6 +82,6 @@ steps: commands: - docker-compose up -d -when: +trigger: branch: - release/** From cca91ce48e3bce763c1c9942efeeac83334d0410 Mon Sep 17 00:00:00 2001 From: mozzie Date: Thu, 23 Mar 2023 14:00:03 +0800 Subject: [PATCH 4/4] =?UTF-8?q?cd:=20=E4=BF=AE=E6=94=B9drone=20build?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.yml | 71 +++++++++++++++++++++++++++++++++--------------------- 1 file changed, 43 insertions(+), 28 deletions(-) diff --git a/.drone.yml b/.drone.yml index 939e0c5..394d876 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,7 +1,49 @@ --- kind: pipeline type: docker -name: admin & web 资源发布 +name: admin 资源发布 + +volumes: + - name: node_modules + host: + path: /home/drone/cache/node_modules + +steps: + # admin管理 + - name: build-admin + image: node:16.19-alpine + volumes: + - name: node_modules + path: /drone/src/node_modules + commands: + - pwd + - node -v + - npm -v + - npm install -g pnpm + - pnpm i + - pnpm build:admin + + - name: deploy-admin + image: appleboy/drone-scp:1.6 + settings: + host: + - backset.cn + username: root + password: cr654654. + port: 22 + overwrite: true + command_timeout: 2m + target: /www/wwwroot/nginx/html/backset.cn/ + source: ./apps/admin/dist/* + +trigger: + branch: + - release/** + +--- +kind: pipeline +type: docker +name: web 资源发布 volumes: - name: node_modules @@ -37,33 +79,6 @@ steps: target: /www/wwwroot/nginx/html/backset.cn/ source: ./apps/web/dist/* - # admin管理 - - name: build-admin - image: node:16.19-alpine - volumes: - - name: node_modules - path: /drone/src/node_modules - commands: - - pwd - - node -v - - npm -v - - npm install -g pnpm - - pnpm i - - pnpm build:admin - - - name: deploy-admin - image: appleboy/drone-scp:1.6 - settings: - host: - - backset.cn - username: root - password: cr654654. - port: 22 - overwrite: true - command_timeout: 2m - target: /www/wwwroot/nginx/html/backset.cn/ - source: ./apps/admin/dist/* - trigger: branch: - release/**