Skip to content

Commit

Permalink
add variable.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
rsonghuster committed Aug 8, 2024
1 parent 5bdc6d1 commit ac3b3bd
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 21 deletions.
3 changes: 2 additions & 1 deletion web-framework/python/flask/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Type: Project
Name: start-fc-flask
Provider:
- 阿里云
Version: 0.0.5
Version: 0.0.6
Description: 本案例将Flask框架,这一非常受欢迎的Python Web框架,快捷创建并部署到阿里云函数计算 FC。
HomePage: https://github.com/devsapp/start-web-framework
Organization: 阿里云函数计算(FC)
Expand Down Expand Up @@ -60,5 +60,6 @@ Parameters:
title: 域名配置
type: string
default: auto
description: 函数计算自定义域名, 如果为 auto,则会下发一个一定有效期的仅支持 http 临时测试域名(切莫用于生产)
required: false
x-domain: true
2 changes: 1 addition & 1 deletion web-framework/python/flask/src/build.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
framework:
fc-flask:
defaultBuilder:
languages:
- python3.10
Expand Down
29 changes: 10 additions & 19 deletions web-framework/python/flask/src/s.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,10 @@ access: "{{ access }}"
vars:
region: "{{ region }}"
functionName: "{{ functionName }}"

resources:
framework:
component: fc3
# actions:
# pre-deploy:
# - run: mkdir python
# path: ./code
# - run: pip install -r requirements.txt -t ./python
# path: ./code
fc-flask:
component: fc3@dev
props:
timeout: 60
cpu: 1
Expand All @@ -36,6 +31,7 @@ resources:
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
PYTHONPATH: /opt/python:/code/python:/code
TZ: Asia/Shanghai
SEARCH_ENGINE: '{{ search_engine }}'
functionName: ${vars.functionName}
code: ./code
layers:
Expand All @@ -50,14 +46,9 @@ resources:
- PUT
- DELETE
authType: anonymous

fc3_domain_0:
component: fc3-domain
props:
region: ${vars.region}
domainName: "{{ domainName }}"
protocol: HTTP
routeConfig:
routes:
- path: /*
functionName: ${vars.functionName}
customDomain:
domainName: "{{ domainName }}"
protocol: HTTP
route:
path: /*
qualifier: LATEST
7 changes: 7 additions & 0 deletions web-framework/python/flask/src/variable.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
services: #服务变量
fc-flask:
search_engine:
title: 使用的搜索引擎
type: string
default: 'www.baidu.com'
description: 使用的搜索引擎地址

0 comments on commit ac3b3bd

Please sign in to comment.