ci: 增加部署脚本
This commit is contained in:
parent
203d30a8c6
commit
e30de01f8c
47
.drone.yml
Normal file
47
.drone.yml
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: default
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: deploy
|
||||||
|
image: appleboy/drone-ssh
|
||||||
|
settings:
|
||||||
|
host:
|
||||||
|
- 148.135.109.242
|
||||||
|
username: root
|
||||||
|
key:
|
||||||
|
from_secret: ssh_key
|
||||||
|
passphrase:
|
||||||
|
from_secret: ssh_passphrase
|
||||||
|
port: 22
|
||||||
|
command_timeout: 2m
|
||||||
|
script:
|
||||||
|
- echo "Go to the project directory"
|
||||||
|
- cd /root/develop/discord-dota-bot
|
||||||
|
- echo "Pull the latest code"
|
||||||
|
- git pull
|
||||||
|
- echo "Restart service"
|
||||||
|
- supervisorctl restart dotabot
|
||||||
|
script_stop: true
|
||||||
|
|
||||||
|
- name: discord notification
|
||||||
|
image: appleboy/drone-discord
|
||||||
|
settings:
|
||||||
|
webhook_id:
|
||||||
|
from_secret: discord_webhook_id
|
||||||
|
webhook_token:
|
||||||
|
from_secret: discord_webhook_token
|
||||||
|
# message: |
|
||||||
|
# Drone Build #${DRONE_BUILD_NUMBER} ${DRONE_BUILD_STATUS}
|
||||||
|
# Project: ${DRONE_REPO_NAME}
|
||||||
|
# Branch: ${DRONE_BRANCH}
|
||||||
|
# Commit: ${DRONE_COMMIT_SHA:0:8}
|
||||||
|
# [Build Log](${DRONE_BUILD_LINK})
|
||||||
|
when:
|
||||||
|
status: [success, failure]
|
||||||
|
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
- name: dockersock
|
||||||
|
host:
|
||||||
|
path: /var/run/docker.sock
|
||||||
Loading…
x
Reference in New Issue
Block a user