Knowing that eb deploy
will deploy anything in your git repo, what is the best way to include files in that are included in .gitignore
? I.e. config scripts with credentials etc.
Thanks in advance!
Knowing that eb deploy
will deploy anything in your git repo, what is the best way to include files in that are included in .gitignore
? I.e. config scripts with credentials etc.
Thanks in advance!
The answer is creating an .ebignore
file. Here is how it works:
If you have my_keys.php
in your .gitignore
because you don't want to commit it because of sensitive info, create an .ebignore
file and only add files that you don't want to be distributed to your instances.
If you don't add my_keys.php
to your .ebignore
, it will compile it and distribute while .gitignore
will keep it out of your remote repo.
This behavior is explained in AWS docs:
If .ebignore isn't present, but .gitignore is, the EB CLI ignores files specified in .gitignore. If .ebignore is present, the EB CLI doesn't read .gitignore.