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!
I want to use AWS CodeCommit to deploy incremental code updates to an AWS Elastic Beanstalk environment without re-uploading my entire project. You can use the Elastic Beanstalk Command Line Interface (EB CLI) to deploy your application directly from a CodeCommit repository. Install the EB CLI.
You can use the AWS Elastic Beanstalk console to upload an updated source bundle and deploy it to your Elastic Beanstalk environment, or redeploy a previously uploaded version. Each deployment is identified by a deployment ID.
Select an environment, and then choose Deploy . If you deploy often, consider using the Elastic Beanstalk Command Line Interface (EB CLI) to manage your environments. The EB CLI creates a repository alongside your source code.
Configure your Amazon EC2 instances in an Elastic Beanstalk environment by using Elastic Beanstalk configuration files (.ebextensions). Configuration changes made to your Elastic Beanstalk environment won't persist if you use the following configuration methods:
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With