Skip to content

Commit

Permalink
📝 添加腾讯云函数文档
Browse files Browse the repository at this point in the history
  • Loading branch information
Sitoi committed May 23, 2021
1 parent fe32927 commit 6db2f76
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 17 deletions.
Binary file added docs/img/scf_config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/scf_create.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/scf_install.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/scf_test.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 21 additions & 13 deletions docs/tencent-scf.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,35 @@
# 腾讯云函数教程

## 方式一、下载到本地修改后上传
### 一、创建云函数

> (腾讯云函数相关教程请自行百度)
> 地域选哪里都可以
### 一、下载(Clone)本项目到本地
![创建云函数](img/scf_create.png)

> ⚠️ 下载的需要解压压缩包

- 下载地址: [https://pypi.org/project/dailycheckin](https://pypi.org/project/dailycheckin)
```python
# -*- coding: utf-8 -*-
from dailycheckin.main import checkin

### 二、创建并修改 config.json 配置文件

拷贝 `config/config.template.json``config/config.json` 并修改
def main_handler(event, context):
checkin()
```

参考[配置说明文档](https://sitoi.github.io/dailycheckin/settings/) ,并修改 `config/config.json`
### 二、安装依赖包

### 三、上传至【腾讯云函数】
![安装依赖包](img/scf_install.png)

云函数 → 函数服务 → 新建 → 自定义创建 → 本地上传文件夹 → 选择带有自定义配置文件的文件夹上传
```bash
cd src
pip3 install dailycheckin -t .
```

### 四、配置定时触发器
### 三、添加配置文件

进入函数 → 触发管理 → 新建触发器 → 安装下图进行配置
![添加配置文件](img/scf_config.png)

### 四、部署测试

![部署测试](img/scf_test.png)

![触发器配置](img/scf_timer.png)
4 changes: 0 additions & 4 deletions requirements.txt

This file was deleted.

0 comments on commit 6db2f76

Please sign in to comment.