Skip to content

Commit cb15799

Browse files
committed
add variable.yaml
1 parent 5bdc6d1 commit cb15799

File tree

4 files changed

+26
-21
lines changed

4 files changed

+26
-21
lines changed

web-framework/python/flask/publish.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Type: Project
33
Name: start-fc-flask
44
Provider:
55
- 阿里云
6-
Version: 0.0.5
6+
Version: 0.0.7
77
Description: 本案例将Flask框架,这一非常受欢迎的Python Web框架,快捷创建并部署到阿里云函数计算 FC。
88
HomePage: https://github.com/devsapp/start-web-framework
99
Organization: 阿里云函数计算(FC)
@@ -60,5 +60,6 @@ Parameters:
6060
title: 域名配置
6161
type: string
6262
default: auto
63+
description: 函数计算自定义域名, 如果为 auto,则会下发一个一定有效期的仅支持 http 临时测试域名(切莫用于生产)
6364
required: false
6465
x-domain: true

web-framework/python/flask/src/build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
framework:
1+
fc-flask:
22
defaultBuilder:
33
languages:
44
- python3.10

web-framework/python/flask/src/s.yaml

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,10 @@ access: "{{ access }}"
99
vars:
1010
region: "{{ region }}"
1111
functionName: "{{ functionName }}"
12+
1213
resources:
13-
framework:
14-
component: fc3
15-
# actions:
16-
# pre-deploy:
17-
# - run: mkdir python
18-
# path: ./code
19-
# - run: pip install -r requirements.txt -t ./python
20-
# path: ./code
14+
fc-flask:
15+
component: fc3@dev
2116
props:
2217
timeout: 60
2318
cpu: 1
@@ -36,6 +31,8 @@ resources:
3631
PATH: /var/fc/lang/python3.10/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/ruby/bin:/opt/bin:/code:/code/bin
3732
PYTHONPATH: /opt/python:/code/python:/code
3833
TZ: Asia/Shanghai
34+
CHAT_API_URL: '{{ chat_api_url }}'
35+
CHAT_API_TOKEN: '{{ chat_api_token }}'
3936
functionName: ${vars.functionName}
4037
code: ./code
4138
layers:
@@ -50,14 +47,9 @@ resources:
5047
- PUT
5148
- DELETE
5249
authType: anonymous
53-
54-
fc3_domain_0:
55-
component: fc3-domain
56-
props:
57-
region: ${vars.region}
58-
domainName: "{{ domainName }}"
59-
protocol: HTTP
60-
routeConfig:
61-
routes:
62-
- path: /*
63-
functionName: ${vars.functionName}
50+
customDomain:
51+
domainName: "{{ domainName }}"
52+
protocol: HTTP
53+
route:
54+
path: /*
55+
qualifier: LATEST
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
services: #服务变量
2+
fc-flask:
3+
chat_api_url:
4+
title: chat_api_url
5+
type: string
6+
default: 'https://api.openai.com/v1'
7+
description: chat api 服务的 url
8+
chat_api_token:
9+
title:
10+
type: string
11+
sensitive: true
12+
description: chat api 服务的 token

0 commit comments

Comments
 (0)