添加自动化脚本
This commit is contained in:
52
.drone.yml
Normal file
52
.drone.yml
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user