预先提供的参数要在Shell中使用所需提示

发布于 2025-02-09 19:30:51 字数 525 浏览 2 评论 0 原文

因此,我必须在Jenkins上使用AWSEB CLI部署AWS Elastic Beanstalk应用程序。当我尝试使用命令时,

eb init

它需要一些信息和凭据。凭据存储为参数,也可以是Jenkins实例上的秘密文件。命令没有这样的东西 - 参数一开始就提供它。是否有任何解决方案可以提供代码中的所有参数,在运行时,此命令现在可以正常使用,现在可以提供此命令,依​​此类推?这样的东西:

eb init --username XXX --password XXX --others XXX

这是该命令的文档

So I have to make deployment of AWS Elastic Beanstalk application with AWSEB CLI on Jenkins. When i try to use command

eb init

It requires some information and credentials. Credentials are stored as parameters or could be a secret file on Jenkins instance. Command have no such things like --parameter to provide it at start. Is there any solution to provide all parameters in the code that in runtime this command will now okay now this is provided now this and so on? Something like this:

eb init --username XXX --password XXX --others XXX

Here is documentation for that command
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3-configuration.html

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

拥抱影子 2025-02-16 19:30:52

此答案有助于您的问题吗?看来您可以将一些参数设置为环境变量,并将其设置为标志。例如。

$ export AWS_ACCESS_KEY_ID="xxx"
$ export AWS_SECRET_ACCESS_KEY="xxx"
$ export AWS_DEFAULT_REGION="xxx"

然后

eb init --region eu-west-1 --platform <platform-name> appname

Will this answer help your issue? It seems you can set some of the parameters as Environment variables and rest as flags.. For example.

$ export AWS_ACCESS_KEY_ID="xxx"
$ export AWS_SECRET_ACCESS_KEY="xxx"
$ export AWS_DEFAULT_REGION="xxx"

Then

eb init --region eu-west-1 --platform <platform-name> appname
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文