-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support deploy and remove command only with asyncInvokeConfig
- Loading branch information
1 parent
03b3ed7
commit 344c32e
Showing
10 changed files
with
185 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
edition: 3.0.0 # 命令行YAML规范版本,遵循语义化版本(Semantic Versioning)规范 | ||
name: test-node-app # 项目名称 | ||
access: quanxi | ||
|
||
vars: | ||
region: ${env('REGION', 'cn-huhehaote')} | ||
|
||
resources: | ||
fcDemo: # 业务名称/模块名称 | ||
component: ${env('fc_component_version', path('../../../'))} | ||
props: # 组件的属性值 | ||
region: ${vars.region} | ||
functionName: fc3-event-part-${env('fc_component_function_name', 'nodejs14')} | ||
runtime: ${env('fc_component_runtime', 'nodejs14')} | ||
code: ./code | ||
handler: event.handler | ||
memorySize: 128 | ||
timeout: 30 | ||
instanceLifecycleConfig: | ||
initializer: | ||
handler: event.initializer | ||
timeout: 10 | ||
|
||
triggers: | ||
- triggerName: httpTrigger # 触发器名称 | ||
triggerType: http # 触发器类型 | ||
description: 'xxxx' | ||
qualifier: test # 触发服务的版本 | ||
triggerConfig: | ||
authType: anonymous # 鉴权类型,可选值:anonymous、function | ||
disableURLInternet: false # 是否禁用公网访问 URL | ||
methods: # HTTP 触发器支持的访问方法,可选值:GET、POST、PUT、DELETE、HEAD | ||
- GET | ||
- POST | ||
|
||
asyncInvokeConfig: | ||
destinationConfig: | ||
onFailure: | ||
destination: acs:mns:${vars.region}::/topics/serverless-devs-fc3-ci-test/messages | ||
onSuccess: | ||
destination: acs:fc:${vars.region}::functions/serverless-devs-ci-async-invoke-config-succ | ||
maxAsyncEventAgeInSeconds: 360 | ||
maxAsyncRetryAttempts: 3 | ||
qualifier: test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#! /bin/bash | ||
# s remove -y -t s2.yaml | ||
s deploy --function -t s2.yaml | ||
versionId=$(s version publish -t s2.yaml --silent -o json | jq -r '."versionId"') | ||
echo "latest version = $versionId" | ||
if [[ "$versionId" -gt 1 ]]; then | ||
mainVersion=$((versionId - 1)) | ||
echo "main version = $mainVersion" | ||
s alias publish --alias-name test --version-id $mainVersion --vw "{\"$versionId\": 0.2}" -t s2.yaml | ||
else | ||
s alias publish --alias-name test --version-id $versionId -t s2.yaml | ||
fi | ||
|
||
s deploy --trigger -t s2.yaml | ||
s deploy --async-invoke-config -t s2.yaml | ||
s info -t s2.yaml | ||
s alias list -t s2.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.