0

我试图弄清楚如何在单个存储库中设置两个或多个应用程序。

可以说:我想为生产(P)和开发(D)保留单独的 Eb 应用程序,每个应用程序都有一个环境(P > env-p & D > env-d)。那么我如何配置我的存储库,主分支指向 P > env-p,开发分支指向 D > env-d。

注意:我已经在具有不同应用程序的单个 AWS 账户中设置了 Elastic Beanstalk。我尝试过搜索,但找不到与此相关的任何内容。

如果有任何机构这样做,请分享您的观点。

提前致谢。

4

2 回答 2

-1

If I understand you correctly you want to run an application with two different environments, for two different branches.

You can do that with a config file in: .elasticbeanstalk/config.yml

branch-defaults:
  master:
    environment: master
    default_region: ap-southeast-2
    default_ec2_keyname: master_key
    profile: master_profile
  staging:
    environment: staging
  develop:
    environment: develop    
global:
  application_name: my_application
  default_ec2_keyname: develop_key
  default_platform: Python 2.7
  default_region: ap-southeast-1
  profile: develop_profile
  sc: git

It will create this file when you do eb init for each branch, but I have seen it sometimes needs some manual edit.

Here is another answer for a similar question with more discussion.

AWS Elastic Beanstalk deploy to multiple applications

Related documentation:

于 2017-12-06T12:38:24.360 回答
-2

在相同情况下,我对 filebeat 配置也有类似的问题。

基本上,您需要使用环境变量来区分环境,然后根据您设置的环境变量在 container_commands 部分运行不同的命令。

你可以在这里看到我的工作示例: https ://www.dativa.com/simplifying-filebeat-logging-with-elastic-beanstalk/

于 2017-12-05T13:44:58.163 回答