DroneDemos/.drone.yml

105 lines
2.5 KiB
YAML

---
kind: pipeline
type: docker
name: "Docker Pipeline"
steps:
- name: "中文STEP"
image: node:latest
pull: if-not-exists
commands:
- echo "********************"
- date
- whoami
- hostname
- echo "********************"
- name: "测试Python用例"
image: "lzwang/python3.10:nightly"
pull: if-not-exists
commands:
- pip install --upgrade pip
- pip -V
- python -V
- pip install -r ./python/requirements.txt
- pwd
- ls -la
- python ./python/hello.py
- pytest --cov ./python/
- name: notify
image: drillster/drone-email
pull: if-not-exists
settings:
host: smtp.exmail.qq.com
port: 465
username: lzwang
from: noreply@lzwang.ltd
password:
from_secret: work_wx_noreply_password
skip_verify: true
recipients:
- lzwang1994@163.com
subject: "${DRONE_REPO_NAME} Build No.${DRONE_BUILD_NUMBER}"
body: "${DRONE_COMMIT_AUTHOR} please visit ${DRONE_BUILD_LINK}"
- name: "CI失败 微信推送"
# https://plugins.drone.io/plugins/wechat-2
image: clem109/drone-wechat
pull: if-not-exists
settings:
corpid:
from_secret: wechat_corp_id
corp_secret:
from_secret: wechat_corp_secret
agent_id:
from_secret: wechat_agent_id
title: "${DRONE_REPO_NAME} ⚠️"
description: "Build No.${DRONE_BUILD_NUMBER} FAILED.
${DRONE_COMMIT_AUTHOR} please fix it, for more detail
visit ${DRONE_BUILD_LINK}"
msg_url: ${DRONE_BUILD_LINK}
btn_txt: btn
when:
status:
- failure
- name: "CI通过 微信推送"
# https://plugins.drone.io/plugins/wechat-2
image: clem109/drone-wechat
pull: if-not-exists
settings:
corpid:
from_secret: wechat_corp_id
corp_secret:
from_secret: wechat_corp_secret
agent_id:
from_secret: wechat_agent_id
title: "${DRONE_REPO_NAME} ✅"
description: "Build No.${DRONE_BUILD_NUMBER} Success!
${DRONE_COMMIT_AUTHOR}, for more detail visit ${DRONE_BUILD_LINK}"
msg_url: ${DRONE_BUILD_LINK}
btn_txt: btn
when:
status:
- success
---
kind: pipeline
type: ssh
name: SSH Pipeline
server:
host:
from_secret: aus_host
user:
from_secret: aus_user
password:
from_secret: aus_pw
steps:
- name: Say hello
commands:
- echo hello world
- neofetch