From 7e98545d8e67dd5ebda2934a433921056bc51f6b Mon Sep 17 00:00:00 2001 From: anfu Date: Thu, 11 Jun 2026 17:40:30 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.yml | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..79a990e --- /dev/null +++ b/.drone.yml @@ -0,0 +1,52 @@ +--- +kind: pipeline +type: docker +name: deploy + +trigger: + branch: + - main + - master + event: + - push + +steps: + - name: package + image: docker.1ms.run/library/alpine:latest + commands: + - apk add --no-cache tar + - tar czf feishu-approval.tar.gz --exclude=.git --exclude=feishu-approval.tar.gz . + + - name: upload + image: appleboy/drone-scp:1.6.14 + settings: + host: + from_secret: deploy_host + username: + from_secret: deploy_user + port: 22 + target: /tmp + source: + - feishu-approval.tar.gz + overwrite: true + + - name: deploy + image: appleboy/drone-ssh:1.0.43 + settings: + host: + from_secret: deploy_host + username: + from_secret: deploy_user + port: 22 + script: + - set -e + - 'DEPLOY_PATH="/www/wwwroot/node_project"' + - 'ARCHIVE="/tmp/feishu-approval.tar.gz"' + - pm2 stop feishu_approval + - test -f "$ARCHIVE" + - mkdir -p "$DEPLOY_PATH" + - find "$DEPLOY_PATH" -mindepth 1 -delete + - tar xzf "$ARCHIVE" -C "$DEPLOY_PATH" + - chmod +x "$DEPLOY_PATH/deploy/start.sh" + - echo "Deploy OK -> $DEPLOY_PATH" + - pm2 start feishu_approval From 11778fc3c93a747fdcfb168ca7c5a6ea048392b2 Mon Sep 17 00:00:00 2001 From: anfu Date: Thu, 11 Jun 2026 17:44:11 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.drone.yml b/.drone.yml index 79a990e..90095bf 100644 --- a/.drone.yml +++ b/.drone.yml @@ -24,6 +24,8 @@ steps: from_secret: deploy_host username: from_secret: deploy_user + password: + from_secret: deploy_password port: 22 target: /tmp source: @@ -37,6 +39,8 @@ steps: from_secret: deploy_host username: from_secret: deploy_user + password: + from_secret: deploy_password port: 22 script: - set -e From 9d531ddd498dca8c4a531adaee767663a23142a3 Mon Sep 17 00:00:00 2001 From: anfu Date: Thu, 11 Jun 2026 17:44:54 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E6=8C=87=E5=AE=9A=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E8=8A=82=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.drone.yml b/.drone.yml index 90095bf..52768ad 100644 --- a/.drone.yml +++ b/.drone.yml @@ -3,6 +3,9 @@ kind: pipeline type: docker name: deploy +node: + runner: localagent + trigger: branch: - main From c4913f2eeba9b5ea78e0eeda638eb4421d26c9e3 Mon Sep 17 00:00:00 2001 From: anfu Date: Thu, 11 Jun 2026 17:45:58 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E6=8C=87=E5=AE=9A=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E8=8A=82=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 52768ad..7c89896 100644 --- a/.drone.yml +++ b/.drone.yml @@ -4,7 +4,7 @@ type: docker name: deploy node: - runner: localagent + runner: ip165 trigger: branch: From 456a626e94d41fbf7e995413138a20bc762bfdd7 Mon Sep 17 00:00:00 2001 From: anfu Date: Thu, 11 Jun 2026 17:47:38 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=89=93=E5=8C=85?= =?UTF-8?q?=E7=9B=AE=E5=BD=95?= 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 7c89896..4a9227c 100644 --- a/.drone.yml +++ b/.drone.yml @@ -18,7 +18,7 @@ steps: image: docker.1ms.run/library/alpine:latest commands: - apk add --no-cache tar - - tar czf feishu-approval.tar.gz --exclude=.git --exclude=feishu-approval.tar.gz . + - tar czf /tmp/feishu-approval.tar.gz --exclude=.git -C . . - name: upload image: appleboy/drone-scp:1.6.14 @@ -32,7 +32,7 @@ steps: port: 22 target: /tmp source: - - feishu-approval.tar.gz + - /tmp/feishu-approval.tar.gz overwrite: true - name: deploy From b7b042aa4086889ce0a4bc703f7305538e1ef659 Mon Sep 17 00:00:00 2001 From: anfu Date: Thu, 11 Jun 2026 17:48:54 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=95=9C=E5=83=8F?= =?UTF-8?q?=E7=89=88=E6=9C=AC?= 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 4a9227c..386415a 100644 --- a/.drone.yml +++ b/.drone.yml @@ -21,7 +21,7 @@ steps: - tar czf /tmp/feishu-approval.tar.gz --exclude=.git -C . . - name: upload - image: appleboy/drone-scp:1.6.14 + image: appleboy/drone-scp settings: host: from_secret: deploy_host @@ -36,7 +36,7 @@ steps: overwrite: true - name: deploy - image: appleboy/drone-ssh:1.0.43 + image: appleboy/drone-ssh settings: host: from_secret: deploy_host From 3ac99b84847b64aa85d7dd84a6b5c0078a2ac080 Mon Sep 17 00:00:00 2001 From: anfu Date: Thu, 11 Jun 2026 17:50:10 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E4=B8=8D=E8=87=AA=E5=8A=A8=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.drone.yml b/.drone.yml index 386415a..b2c2299 100644 --- a/.drone.yml +++ b/.drone.yml @@ -22,6 +22,7 @@ steps: - name: upload image: appleboy/drone-scp + pull: if-not-exists settings: host: from_secret: deploy_host @@ -37,6 +38,7 @@ steps: - name: deploy image: appleboy/drone-ssh + pull: if-not-exists settings: host: from_secret: deploy_host From 9ebb02f7c72b723d8855f1ef2e11b355daa4ae0e Mon Sep 17 00:00:00 2001 From: anfu Date: Thu, 11 Jun 2026 17:52:20 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=9B=B8=E5=AF=B9?= =?UTF-8?q?=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index b2c2299..7f07beb 100644 --- a/.drone.yml +++ b/.drone.yml @@ -18,7 +18,8 @@ steps: image: docker.1ms.run/library/alpine:latest commands: - apk add --no-cache tar - - tar czf /tmp/feishu-approval.tar.gz --exclude=.git -C . . + - mkdir -p dist + - tar czf dist/feishu-approval.tar.gz --exclude=.git --exclude=dist -C . . - name: upload image: appleboy/drone-scp @@ -33,7 +34,8 @@ steps: port: 22 target: /tmp source: - - /tmp/feishu-approval.tar.gz + - dist/feishu-approval.tar.gz + strip_components: 1 overwrite: true - name: deploy