通过CircleCI部署无服务器框架 [英] Serverless Framework deploy through CircleCI

查看:74
本文介绍了通过CircleCI部署无服务器框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将无服务器集成到我的 circleci 工作流程中。
我尝试先将密钥秘密都添加到 AWS权限,但这没有用。
然后,我在环境变量密钥秘密 $ c>并在我的配置文件中:

I'm trying to integrate serverless to my circleci workflow. I tried first adding both, key and secret to AWS permissions, but that did not work. Then, I added key and secret to Environment variables and in my config file:

sudo npm install -g serverless
sls config credentials --provider aws --key $AWS_ACCESS_KEY_ID --secret $AWS_SECRET_ACCESS_KEY
sls deploy -v

但是我看到了相同的错误:

But I see the same error:

Serverless Error ---------------------------------------
You are not currently logged in. Follow instructions in http://slss.io/run-in-cicd to setup env vars for authentication.

有人遇到过这个问题吗?我在网上找不到答案或提示。谢谢。

Anyone had this issue? I could not find an answer or hint online. Thanks.

推荐答案

只需检查Circleci就停止支持 AWS权限作为可配置项设置页面中的选项。

Just checked Circleci stopped supporting AWS Permissions as a configurable option in the settings page.

您需要将凭据设置为项目的环境变量。凭据应准确命名为 AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY

You need to set the credentials as environment variables for the projects. The credentials should be named exactly AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY.

这就是您需要做的。您无需执行任何其他步骤。我在我的项目上尝试了此方法,并成功了。

that's all you need to do. you don't have to do any additional step. I tried this on my project and it worked.

您的部署步骤应该简单地是

Your deployment step should simply be

sls deploy

这篇关于通过CircleCI部署无服务器框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆