DroneDemos/.drone.yml

101 lines
2.2 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 ./python/test_demo.py
- name: codecov
image: robertstettner/drone-codecov
settings:
token:
from_secret: codecov_pytest
files:
- python/coverage/unit/lcov.info
flags:
- unit
- 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