AWS Elastic Beanstalk + Git Submodules

I use Amazon Elastic Beanstalk to deploy my application through Git, and I have submodules inside my Git. Of course, when I look at the directories where the data for the submodules should be, there is nothing, because the submodules were not initialized.

The elastic beanstalk does not seem to support submodules. It's right? If so, how can I convince Git to give me the functions of a submodule, but still load all the code of the submodule when I click on the main repo?

+4
source share
3 answers

Elastic Beanstalk supports submodules if you just make sure Git is installed in the AMI that you are using Configuring and Configuring AWS Elastic Beanstalk Environments . You can do this by providing the configuration in your Git repository:

  • Create a configuration file with the extension .config (e.g. myapp.config ) and place it in the top level .ebextensions directory of your Git repo

  • In this file, specify the dependencies:

packages:

  <name of package manager>: <package name>: <version> 

eg:

packages:

  yum: git: [] 
  • make sure you map the name of package manager to the AMI you are using, e.g. yum for Amazon Linux, apt for Ubuntu.

  • you may have to adapt the script construct to initialize the submodules since EB will not do this for you

  • commit, click and expand and go

+4
source

Which container? Java, Ruby, etc.?

There are different deployment tools, you are not just stuck with the eb command line available in aws. I'm working on the config / rake pearl (which uses eb_deployer ), which I will be releasing soon, just using a zip file, not git push, so this will work. You can also try ebs-deploy .

0
source

If you are using awsebcli installed via pip, this may help you.

We found the source code for the AWS-EB client 3.10.1 on PyPi.

The problem is how git repositories are handled when you download the project source code to load it into AWS. If you are not using git for your AWS project, the entire project directory (including any other git modules in subdirectories you may have in it) is encrypted and sent to AWS. If you use git, then all registered or phased code, except for submodules, is encrypted and sent to AWS. git missing submodules.

We wrote a fix for this problem, changing the behavior so that the submodules are also added to the archive with a zipper. You can see the fix at github.com/uppercasebrands/awsebcli-3.10.1/compare/eb-deploy-submodule in our git repository, which is created from the original PyPi package.

You can install fixed awsebcli-3.10.1, which now supports submodules using pip:

pip install --upgrade git+https://github.com/uppercasebrands/ awsebcli-3.10.1.git@eb-deploy-submodule

0
source

Source: https://habr.com/ru/post/1496969/


All Articles