From 6fecccbe1a996f675fb509e2bfb95f8c0b3384dd Mon Sep 17 00:00:00 2001 From: BryantHe Date: Tue, 14 Jun 2022 16:12:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=20drone=20=E6=96=87=E4=BB=B6?= =?UTF-8?q?=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.yml | 33 ++++++++++++++++++++++++++++----- test.py | 1 + 2 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 test.py diff --git a/.drone.yml b/.drone.yml index e30e632..0d12394 100644 --- a/.drone.yml +++ b/.drone.yml @@ -5,8 +5,31 @@ # 代码拉取后会使用 python:3.7-alpine3.8 镜像来执行项目目录下的 a.py 文件 # 由于现在仓库中并不存在 a.py 文件所以第次的测试肯定是失败的 -pipeline: - run: - image: 3.9.13-alpine3.15 - commands: - - python3 a.py \ No newline at end of file +kind: pipeline +type: docker +name: default + +platform: + os: linux + arch: amd64 + + +steps: +- name: run + image: python:3.9.13-alpine3.15 + commands: + - python3 test.py +- name: deploy + image: appleboy/drone-ssh + settings: + host: 118.25.83.116 + username: root + key: + from_secret: ssh_key + port: 22 + script_stop: true + script: + - echo "yulong test" > /tmp/yulong_test.drone + + + diff --git a/test.py b/test.py new file mode 100644 index 0000000..5b40bfb --- /dev/null +++ b/test.py @@ -0,0 +1 @@ +print('hello drone') \ No newline at end of file