在使用bitbucket管道在AWS上部署lambda时,我得到了以下错误
错误:无法设置basepath映射。试着先运行sls create_domain。
错误:在API中找不到‘staging api.simple.Toucele.com’。(/opt/atlassian/pipelines/agent/build/node_modules/serverless-domain-manager/index.js:181:15) ConfigError: getDomain.then.then.catch getDomain.then.then.catch配置中缺少的区域
在…
在runMicrotasksCallback (内部/process/next_tick.js:121:5)
在_combinedTickCallback (内部/process/next_tick.js:131:7)
在process._tickDomainCallback (内部/process/next_tick.js:218:9)
对于调试日志,在设置"SLS_DEBUG=*“环境变量后再次运行。
得到支持
文档: docs.serverless.com Bugs: github.com/serverless/serverless/ Issues : forum.serverless.com
你的环境信息
操作系统: linux节点版本: 8.10.0
框架版本: 1.61.3
插件版本: 3.2.7
SDK版本: 2.3.0
组件核心版本: 1.1.2
组件CLI版本: 1.4.0
因此,我将无服务器域管理器更新为最新版本3.3.1。
在更新无服务器域管理器之后,我尝试部署lambda,现在我得到了下面的错误。
无服务器错误
没有找到无服务器插件“无服务器域管理器”。确保它已安装并列在您的无服务器配置文件的"plugins“部分。
serverless.yml片段
plugins:
- serverless-plugin-warmup
- serverless-offline
- serverless-log-forwarding
- serverless-domain-manager
custom:
warmup:
schedule: 'cron(0/10 12-23 ? * MON-FRI *)'
prewarm: true
headers:
- Content-Type
- X-Amz-Date
- Authorization
- X-Api-Key
- X-Amz-Security-Token
- TS-Staging
- x-tss-correlation-id
- x-tss-application-id
stage: ${opt:stage, self:provider.stage}
domains:
prod: api.simple.touchsuite.com
staging: staging-api.simple.touchsuite.com
dev: dev-api.simple.touchsuite.com
customDomain:
basePath: 'svc'
domainName: ${self:custom.domains.${self:custom.stage}}
stage: ${self:custom.stage}bitbucket-管道.片段
image: node:8.10.0
pipelines:
branches:
master:
- step:
caches:
- node
name: Run tests
script:
- npm install --global copy
- npm install
- NODE_ENV=test npm test
- step:
caches:
- node
name: Deploy to Staging
deployment: staging # set to test, staging or production
script:
- npm install --global copy
- npm run deploy:staging
- npm run deploy:integrations:staging
- node -e 'require("./scripts/bitbucket.js").triggerPipeline()'需要一些洞察力,我缺少什么来制造错误?
发布于 2020-01-23 14:02:42
我发现,在Bitbucket中,我需要添加一个npm install命令,以确保模块和插件在尝试运行之前都已安装好。这可能是你的案子中缺少的东西。您还可以为结果的node_modules文件夹打开缓存,这样它就不必每次部署时都下载所有模块。
https://stackoverflow.com/questions/59879547
复制相似问题