-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paths.yaml
91 lines (89 loc) · 2.87 KB
/
s.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
edition: 1.0.0
name: Web IDE
# 秘钥别名
access: "{{ access }}"
# 如下这些参数,可以根据需要进行更换
vars:
region: cn-shenzhen
serviceName: openvscode-server
roleArn: acs:ram::1214128724808624:role/aliyunfcdefaultrole
ossBucket: gdz
accessKeyId: LTAI5t81qJ94CC6f5fKgEUQv
accessKeySecret: xq2I1mQl70bg8vmAR1f4F02Y77OA28
services:
vscode-server:
# 组件名称,后面props的参数根据不同组件而有所不同
component: fc
actions:
pre-deploy:
- run: make release
path: ./
# openvscode-server作为函数的层在发布之前下载,方便直接使用
- plugin: layer-fc
args:
name: openvscode-server
codeUri: http://devsapp.functioncompute.com/devsapp/openvscode-server-v1.67.0.zip
runtime:
- custom
props:
region: ${vars.region}
service:
name: ${vars.serviceName}
internetAccess: true
logConfig: auto
description: "The web ide service."
role: ${vars.roleArn}
function:
name: openvscode-server
description: "The openvscode server function."
timeout: 900
memorySize: 3072
runtime: custom
# 代码位置
codeUri: ./target
# 运行所需环境变量
environmentVariables:
PATH: /opt/openvscode-server/bin:/opt/openvscode-server:/usr/local/bin/apache-maven/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/ruby/bin
ALIYUN_OSS_REGION: ${vars.region}
ALIYUN_ACCESS_KEY_ID: ${vars.accessKeyId}
ALIYUN_ACCESS_KEY_SECRET: ${vars.accessKeySecret}
OSS_BUCKET_NAME: ${vars.ossBucket}
TZ: Asia/Shanghai
# 运行时配置:直接跑 ./ vscode-server,这是go代码编译的结果,可以直接运行
customRuntimeConfig:
command:
- ./vscode-server
args:
- -logtostderr=true
# 运行时暴露的端口
caPort: 9000
# 初始化的访问链接(我们是http方式触发所以能这样指定)
initializer: /initialize
initializationTimeout: 120
# 单实例并发数
instanceConcurrency: 100
# 生命周期调用
instanceLifecycleConfig:
preStop:
handler: /pre-stop
timeout: 600
triggers:
- name: httpTrigger
type: http
config:
authType: anonymous
methods:
- GET
customDomains:
# 域名,如果是auto取值,系统则会默认分配域名
- domainName: auto
protocol: HTTP
routeConfigs:
- path: /*
methods:
- GET
- POST
- PUT
- DELETE
- HEAD
- OPTIONS