【发布时间】:2020-01-15 04:03:38
【问题描述】:
我正在使用 serverless 框架并使用 bitbucket-pipeline 来配置 CI/CD。
我在serverless.yml文件中有如下配置
provider:
name: aws
runtime: nodejs10.x
region: ${opt:region, ${env:AWS_REGION, 'ap-south-1'}}
memorySize: ${opt:memory, ${env:MEMORY_SIZE, 512}}tracing:
apiGateway: ${env:TRACING_API_GATEWAY, true}
我希望能够从CLI 和environment variables 传递变量。
我在 bitbucket 管道变量中为AWS_REGION 设置了环境变量,但没有为MEMORY_SIZE 设置环境变量,因为我想使用默认值。
但这会在运行管道时出错。
Serverless Warning --------------------------------------
A valid option to satisfy the declaration 'opt:region,ap-south-1' could not be found.
Serverless Warning --------------------------------------
A valid environment variable to satisfy the declaration 'env:MEMORY_SIZE,512' could not be found.
Serverless Warning --------------------------------------
A valid environment variable to satisfy the declaration 'env:TRACING_API_GATEWAY,true' could not be found.
【问题讨论】:
标签: serverless-framework bitbucket-pipelines