gpt4 book ai didi

aws-cloudformation - 无服务器安装后 CircleCI 找不到无服务器框架

转载 作者:行者123 更新时间:2023-12-03 07:39:47 26 4
gpt4 key购买 nike

我正在尝试使用 Serverless Compose 通过 CircleCI 将多个服务部署到 AWS。我有 3 个 POC 测试服务,到目前为止,从终端将这些服务部署到个人 AWS 账户效果很好。但是,当我将其配置为使用 config.yml 文件通过 CircleCI 时,我收到此错误:

Could not find the Serverless Framework CLI installation. Ensure Serverless Framework is installed before continuing.

我很困惑,因为我的 config.yml 文件如下所示:

version: 2.1
orbs:
aws-cli: circleci/<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b6d7c1c59bd5dadff68598879887" rel="noreferrer noopener nofollow">[email protected]</a>
serverless-framework: circleci/<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="ef9c8a9d998a9d838a9c9cc2899d8e828a98809d84afddc1dfc1df" rel="noreferrer noopener nofollow">[email protected]</a>
node: circleci/<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="3a54555e5f7a0f140a1408" rel="noreferrer noopener nofollow">[email protected]</a>

jobs:
deploy:
parameters:
stage:
type: string
executor: serverless-framework/default
steps:
- checkout
- aws-cli/install
- serverless-framework/setup
- run:
command: serverless config credentials --provider aws --key $AWS_ACCESS_KEY_ID --secret $AWS_SECRET_ACCESS_KEY
name: Configure serverless
- run:
command: npm install @serverless/compose
name: Install @serverless/compose
- run:
command: serverless deploy --stage << parameters.stage >>
name: Deploy staging

workflows:
deploy-staging:
jobs:
- node/test:
version: 17.3.0
- deploy:
context: aws-*******-developers
name: ******-sandbox-use1
stage: staging

无服务器框架已设置,orb 存在,但提示找不到。在我开始部署暂存之前,所有步骤都会成功。我一直在挖掘文档,但我似乎找不到 CircleCI 出了问题的地方。有谁知道我可能缺少什么?

最佳答案

事实证明这需要一个奇怪的修复,但最好删除以下内容:

  • 球体 serverless-framework: circleci/<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b1c2d4c3c7d4c3ddd4c2c29cd7c3d0dcd4c6dec3daf1839f819f81" rel="noreferrer noopener nofollow">[email protected]</a>
  • 作业中的设置步骤 - serverless-framework/setup
  • Configure Serverless步骤

删除这些内容后,修改 Install @serverless/compose运行步骤npm install并安装所有软件包。然后运行npx serverless deploy而不是serverless deploy 。这解决了我的问题。

关于aws-cloudformation - 无服务器安装后 CircleCI 找不到无服务器框架,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72321465/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com