Skip to content

Commit

Permalink
Merge pull request #37 from devsapp/create-support-tags
Browse files Browse the repository at this point in the history
fix:interface add tags and popCore version
  • Loading branch information
rsonghuster authored Jan 14, 2025
2 parents 997576e + 49cc43f commit 94f1a30
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 9 deletions.
7 changes: 7 additions & 0 deletions __tests__/e2e/ci-mac-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ s invoke -e '{"hello":"fc nodejs with auto"}' -t s_auto.yaml
s info -y -t s_auto.yaml
s remove -y -t s_auto.yaml

echo "test nodejs runtime with more vpc and nas auto ..."
export fc_component_function_name=nodejs16-$(uname)-$(uname -m)-$RANDSTR
s deploy -y -t ./s_lock_auto.yaml
s invoke -e '{"hello":"fc nodejs with more vpc and nas auto"}' -t ./s_lock_auto.yaml
s info -y -t ./s_lock_auto.yaml
s remove -y -t ./s_lock_auto.yaml

echo "test deploy with alias"
export fc_component_function_name=nodejs14-$(uname)-$(uname -m)-$RANDSTR
s deploy --function -t s2.yaml
Expand Down
9 changes: 9 additions & 0 deletions __tests__/e2e/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,15 @@ s info -y -t ./s_auto.yaml
s remove -y -t ./s_auto.yaml
cd ..

echo "test nodejs runtime with more vpc and nas auto ..."
cd nodejs
export fc_component_function_name=nodejs16-$(uname)-$(uname -m)-$RANDSTR
s deploy -y -t ./s_lock_auto.yaml
s invoke -e '{"hello":"fc nodejs with more vpc and nas auto"}' -t ./s_lock_auto.yaml
s info -y -t ./s_lock_auto.yaml
s remove -y -t ./s_lock_auto.yaml
cd ..

echo "test deploy with alias"
cd nodejs
export fc_component_function_name=nodejs14-$(uname)-$(uname -m)-$RANDSTR
Expand Down
6 changes: 6 additions & 0 deletions __tests__/e2e/nodejs/s.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ resources:
concurrencyConfig:
reservedConcurrency: 1

tags:
- key: test1
value: value1
- key: test2
value: value2

customDomain:
domainName: auto
protocol: HTTP
Expand Down
5 changes: 4 additions & 1 deletion __tests__/e2e/nodejs/s2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,7 @@ resources:
destination: acs:fc:${vars.region}::functions/serverless-devs-ci-async-invoke-config-succ
maxAsyncEventAgeInSeconds: 360
maxAsyncRetryAttempts: 3
qualifier: test
qualifier: test
tags:
- key: test
value: test_value
46 changes: 46 additions & 0 deletions __tests__/e2e/nodejs/s_lock_auto.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
edition: 3.0.0 # 命令行YAML规范版本,遵循语义化版本(Semantic Versioning)规范
name: test-node-app # 项目名称
access: quanxi

vars:
region: ${env('REGION', 'cn-huhehaote')}

resources:
fcDemo1: # 业务名称/模块名称
component: ${env('fc_component_version', path('../../../'))}
props: # 组件的属性值
region: ${vars.region}
functionName: fc3-event-${env('fc_component_function_name', 'nodejs16')}-f1
runtime: ${env('fc_component_runtime', 'nodejs16')}
code: ./test-auto-code
handler: index.handler
memorySize: 128
timeout: 30
vpcConfig: auto
nasConfig: auto

fcDemo2: # 业务名称/模块名称
component: ${env('fc_component_version', path('../../../'))}
props: # 组件的属性值
region: ${vars.region}
functionName: fc3-event-${env('fc_component_function_name', 'nodejs16')}-f2
runtime: ${env('fc_component_runtime', 'nodejs16')}
code: ./test-auto-code
handler: index.handler
memorySize: 128
timeout: 30
vpcConfig: auto
nasConfig: auto

fcDemo3: # 业务名称/模块名称
component: ${env('fc_component_version', path('../../../'))}
props: # 组件的属性值
region: ${vars.region}
functionName: fc3-event-${env('fc_component_function_name', 'nodejs16')}-f3
runtime: ${env('fc_component_runtime', 'nodejs16')}
code: ./test-auto-code
handler: index.handler
memorySize: 128
timeout: 30
vpcConfig: auto
nasConfig: auto
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@alicloud/fc2": "^2.6.6",
"@alicloud/fc20230330": "^4.1.6",
"@alicloud/pop-core": "^1.7.13",
"@serverless-cd/srm-aliyun-pop-core": "^0.0.7-beta.17",
"@serverless-cd/srm-aliyun-pop-core": "^0.0.7-beta.19",
"@serverless-cd/srm-aliyun-ram20150501": "^0.0.2-beta.9",
"@serverless-cd/srm-aliyun-sls20201230": "0.0.5-beta.3",
"@serverless-devs/diff": "^0.0.3-beta.6",
Expand Down
7 changes: 7 additions & 0 deletions src/interface/function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ export interface IVpcConfig {
vpcId: string;
}

export interface ITags {
key: string;
value: string;
}

export interface IFunction {
functionName: string;
runtime: IRuntime;
Expand Down Expand Up @@ -140,6 +145,8 @@ export interface IFunction {
preStop?: ILifecycleHook;
};

tags?: ITags[];

annotations?: {
headers?: {
[key: string]: string;
Expand Down

0 comments on commit 94f1a30

Please sign in to comment.