Files
kami_boss/.drone.yml
2024-10-02 17:07:56 +08:00

165 lines
3.2 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
kind: pipeline
type: ssh
name: master-machine
server:
host: 43.153.153.27
user: ubuntu
password:
from_secret: www_password
clone:
depth: 1
steps:
- name: clean old container
commands:
- docker ps -a | (grep -q kami_boss; [ $? -eq 0 ] && docker container stop kami_boss && docker container rm kami_boss) || true
- name: deploy to docker compose
commands:
- VERSION=${DRONE_BRANCH}${DRONE_BUILD_NUMBER} docker compose down
- VERSION=${DRONE_BRANCH}${DRONE_BUILD_NUMBER} docker compose up -d
trigger:
branch:
- develop
- production
when:
event:
- push
---
kind: pipeline
type: ssh
name: 绝技服务器
server:
host: 43.153.189.236
user: ubuntu
password:
from_secret: flower2
clone:
depth: 1
steps:
- name: clean old container
commands:
- docker ps -a | (grep -q kami_boss; [ $? -eq 0 ] && docker container stop kami_boss && docker container rm kami_boss) || true
- name: run docker compose
commands:
- VERSION=${DRONE_BRANCH}${DRONE_BUILD_NUMBER} docker compose down
- VERSION=${DRONE_BRANCH}${DRONE_BUILD_NUMBER} docker compose up -d
trigger:
status:
- success
- failure
branch:
- production
when:
event:
- push
---
kind: pipeline
type: ssh
name: 泼兔的服务器
server:
host: 43.156.131.191
user: ubuntu
password:
from_secret: ubuntu-crazy_rabbit2
clone:
depth: 1
steps:
- name: clean old container
commands:
- docker ps -a | (grep -q kami_boss; [ $? -eq 0 ] && docker container stop kami_boss && docker container rm kami_boss) || true
- name: run docker compose
commands:
- VERSION=${DRONE_BRANCH}${DRONE_BUILD_NUMBER} docker compose down
- VERSION=${DRONE_BRANCH}${DRONE_BUILD_NUMBER} docker compose up -d
trigger:
status:
- success
- failure
branch:
- production
when:
event:
- push
---
kind: pipeline
type: ssh
name: 宝宝服务器
server:
host: 43.163.251.22
user: ubuntu
password:
from_secret: baby
clone:
depth: 1
steps:
- name: clean old container
commands:
- docker ps -a | (grep -q kami_boss; [ $? -eq 0 ] && docker container stop kami_boss && docker container rm kami_boss) || true
- name: run docker compose
commands:
- VERSION=${DRONE_BRANCH}${DRONE_BUILD_NUMBER} docker compose down
- VERSION=${DRONE_BRANCH}${DRONE_BUILD_NUMBER} docker compose up -d
trigger:
status:
- success
- failure
branch:
- production
when:
event:
- push
---
kind: pipeline
type: docker
name: server酱微信通知
depends_on:
- 泼兔的服务器
- master-machine
steps:
- name: send-wechat
image: plugins/webhook
pull: if-not-exists
settings:
urls: https://open.feishu.cn/open-apis/bot/v2/hook/1f4a9795-84a9-4cc5-b2c5-0bf05686336b
content_type: application/json
template: |
{
"msg_type":"text",
"content":
{
"text": "项目名称: ${DRONE_REPO_NAME}\n分支${DRONE_BRANCH}\n构建编号${DRONE_BUILD_NUMBER}\n项目构建状态{{ build.status }}"
}
}
trigger:
branch:
- develop
- production
status:
- success
- failure
when:
event:
- push