Elastic Beanstalk with git submodules - deployed code has no execute permissions

Viewed 37

I Use Elastic Beanstalk to deploy a Python Django application over AWS Linux 2 machine. My git project includes another git repository integrated as git submodule.

I followed these instructions.

Specifically I configured:

.elasticbeanstalk/config.yml:

global:
  branch: main
  include_git_submodules: true

.gitmodules file:

[submodule "MyFamousSubmodule"]
    path = MyFamousSubmodule
    url = https://github.com/hoshmy/MyFamousSubmodule.git
    auto-update=yes
    branch=main

Once I eb deploy the whole git repo including the submodule files are deployed successfully to the machine and are visible under /var/app/current. Testing the application throws exception indicating that a certain python module (py file) isn't available. I eb ssh to the machine and discovered that the whole submodules python files don't have execute permissions (-rw------- ).

Other py files, not under the submodule, has appropriate executable permissions (-rwxr-xr-x)

My Question: How to properly set/configure the submodule within the repo and/or the eb for proper deployment?

1 Answers

You can clone separately the submodule on your computer to confirm the py files don't have execute permissions.

If so, and assuming you can contribute to the repository, add them with:

git add --chmod=+x *.py
git commit -m "Add execution permission to py files"
git push

From there, try your eb deploy once more.

Related