From cf9e36da11f7622e14cd8d1145d25655fbddf5b2 Mon Sep 17 00:00:00 2001 From: woni <320753691@qq.com> Date: Mon, 12 Aug 2024 12:04:29 +0800 Subject: [PATCH] add drone --- .drone.yml | 16 ++++++++++++++++ .gitignore | 1 + check-reg-domain.py | 2 +- requirements.txt | 3 +++ 4 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 .drone.yml create mode 100644 .gitignore create mode 100644 requirements.txt diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..08125b4 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,16 @@ +kind: pipeline +type: docker +name: default + +steps: + - name: run-scheduled-task + image: python:3.10 + commands: + - pip install -r requirements.txt # 如果有依赖 + - python task.py + +trigger: + event: + - cron + + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5ceb386 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +venv diff --git a/check-reg-domain.py b/check-reg-domain.py index 8e434f6..7a596a6 100644 --- a/check-reg-domain.py +++ b/check-reg-domain.py @@ -39,7 +39,7 @@ def check_domain_availability(domain_name): except Exception as e: # print(f"域名: {domain_name} 可以注册") - message = f"域名: {domain_name} 可以注册 **" + message = f"域名: {domain_name} 可以注册, {e} **" return message diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..eff02b2 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +python-dateutil==2.9.0.post0 +python-whois==0.9.4 +six==1.16.0