2022-06-14 16:10:00 +08:00
|
|
|
# drone 会自动先拉取代码
|
|
|
|
# 再按顺序执行 pipeline 配置中定义的任务
|
|
|
|
|
|
|
|
# 这个配置定义了一个叫 run 的步骤
|
|
|
|
# 代码拉取后会使用 python:3.7-alpine3.8 镜像来执行项目目录下的 a.py 文件
|
|
|
|
# 由于现在仓库中并不存在 a.py 文件所以第次的测试肯定是失败的
|
|
|
|
|
2022-06-14 17:10:31 +08:00
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: default
|
|
|
|
|
|
|
|
platform:
|
|
|
|
os: linux
|
|
|
|
arch: amd64
|
|
|
|
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: run
|
|
|
|
image: python:3.9.13-alpine3.15
|
|
|
|
commands:
|
2022-06-14 19:34:30 +08:00
|
|
|
- python3 test.py
|
|
|
|
- name: deploy
|
2022-06-14 19:37:04 +08:00
|
|
|
image: appleboy/drone-ssh
|
|
|
|
settings:
|
2022-06-14 19:45:35 +08:00
|
|
|
host: 118.25.83.116
|
|
|
|
username: root
|
|
|
|
key:
|
|
|
|
from_secret: ssh_key
|
|
|
|
port: 22
|
|
|
|
script_stop: true
|
|
|
|
script:
|
2022-06-14 23:01:17 +08:00
|
|
|
- echo "yulong test" > /tmp/yulong_test.drone
|
2022-06-14 23:08:34 +08:00
|
|
|
|
|
|
|
|
|
|
|
|