fix drone config
This commit is contained in:
parent
86eaff16b0
commit
e198e15699
87
.drone.yml
87
.drone.yml
|
@ -42,5 +42,92 @@ steps:
|
|||
- push
|
||||
- custom
|
||||
|
||||
---
|
||||
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: develop
|
||||
|
||||
platform:
|
||||
os: linux
|
||||
arch: amd64
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
include:
|
||||
- develop
|
||||
|
||||
clone:
|
||||
disable: true
|
||||
|
||||
steps:
|
||||
- name: deploy
|
||||
image: appleboy/drone-ssh
|
||||
settings:
|
||||
host:
|
||||
from_secret: host
|
||||
username: root
|
||||
key:
|
||||
from_secret: ssh_key
|
||||
port: 22
|
||||
script_stop: true
|
||||
script:
|
||||
- cd /var/www/todo
|
||||
- git fetch
|
||||
- git checkout ${DRONE_BRANCH}
|
||||
- git reset --hard ${DRONE_COMMIT}
|
||||
- docker-compose down
|
||||
- docker-compose up -d --build
|
||||
- docker image prune -f
|
||||
when:
|
||||
event:
|
||||
include:
|
||||
- pull_request
|
||||
action:
|
||||
include:
|
||||
- opened
|
||||
- reopened
|
||||
- synchronized
|
||||
- name: gitea-pr-comment-failure
|
||||
image: tsakidev/giteacomment:latest
|
||||
settings:
|
||||
gitea_token:
|
||||
from_secret: gitea_token
|
||||
gitea_base_url:
|
||||
from_secret: gitea_base_url
|
||||
comment_title: "部署 sit 环境失败"
|
||||
comment: "${DRONE_PULL_REQUEST_TITLE} 部署 sit 环境失败"
|
||||
when:
|
||||
status:
|
||||
- failure
|
||||
event:
|
||||
include:
|
||||
- pull_request
|
||||
action:
|
||||
include:
|
||||
- opened
|
||||
- reopened
|
||||
- synchronized
|
||||
- name: gitea-pr-comment-success
|
||||
image: tsakidev/giteacomment:latest
|
||||
settings:
|
||||
gitea_token:
|
||||
from_secret: gitea_token
|
||||
gitea_base_url:
|
||||
from_secret: gitea_base_url
|
||||
comment_title: "部署 sit 环境成功"
|
||||
comment: "${DRONE_PULL_REQUEST_TITLE} 部署 sit 环境成功"
|
||||
when:
|
||||
status:
|
||||
- success
|
||||
event:
|
||||
include:
|
||||
- pull_request
|
||||
action:
|
||||
include:
|
||||
- opened
|
||||
- reopened
|
||||
- synchronized
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue