AWS Elastic Beanstalk allows for you to upload a git repository to your environment with a simple eb deploy
command.
I know anything placed inside the .gitignore won't be deployed, but what about source files (sass, uncompressed scripts) I want to keep in the repository, but don't want uploaded on deployment.
Is there a way to only upload specific files?
Follow-up
Using Tal's answer below I was able to remove files on deploy with the following:
container_commands:
remove_src_folder:
command: "rm -rf public/src/"
Given this folder structure:
— .elasticbeanstalk
— .git
— public/
— dist/
— src/
— index.php
The main difference is that in the immutable update, the new instances serve traffic alongside the old ones, while in the blue/green this doesn't happen (you have an instant complete switch from old to new).
Your source bundle must meet the following requirements: Consist of a single ZIP file or WAR file (you can include multiple WAR files inside your ZIP file) Not exceed 512 MB. Not include a parent folder or top-level directory (subdirectories are fine)
Elastic Beanstalk isn't great if you need a lot of environment variables. The simple reason is that Elastic Beanstalk has a hard limit of 4KB to store all key-value pairs. The environment had accumulated 74 environment variables — a few of them had exceedingly verbose names.
Open the Elastic Beanstalk console , and in the Regions list, select your AWS Region. In the navigation pane, choose Environments, and then choose the name of your environment from the list. If you have many environments, use the search bar to filter the environment list. Choose Upload and deploy.
You can ignore files, which are in git using .ebignore
. It will cause .gitignore
to be ignored, so you may need some duplicate rules in both files.
It is documented here:
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3-configuration.html#eb-cli3-ebignore
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