Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS 'eb deploy' always zip all files

i'm new using git with eb cli, for deploy my code to aws elastic beanstalk. I though the most vantage thing on eb cli was deploy specific files (from commit), but every time i commit some files and deploy my application, eb cli zip all project and this is too much for upload all the time. Please help me, i read almost everything about it on aws documentation and there's nothign about it. Thanks!

like image 839
Cassio Pfütz Avatar asked Aug 03 '16 17:08

Cassio Pfütz


People also ask

How does EB deploy work?

Description. Deploys the application source bundle from the initialized project directory to the running application. If git is installed, EB CLI uses the git archive command to create a . zip file from the contents of the most recent git commit command.

When you use AWS Elastic Beanstalk console to deploy a new application?

When you use the AWS Elastic Beanstalk console to deploy a new application or an application version, you'll need to upload a source bundle. 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.

Which of the following Elastic Beanstalk deployment approaches allow you to maintain full capacity while performing an update?

To maintain full capacity during deployments, you can configure your environment to launch a new batch of instances before taking any instances out of service. This option is known as a rolling deployment with an additional batch.


1 Answers

If you want to further customize your deployment and not just deploy your current branch; I believe you're going to have to manually specify an artifact yourself and build the zip yourself before calling eb deploy.

In your .elasticbeanstalk/config.yml:

deploy:
  artifact: some-custom-zip.zip

The artifact should exist in the same directory as the .elasticbeanstalk directory. And you could create a bash script to generate your own custom zip file for uploading use before calling eb deploy or use a Makefile.

Example Makefile:

some-custom-zip.zip: something.py another.py
    zip $@ something.py another.py

deploy: some-custom-zip.zip
    eb deploy

.PHONY: deploy
like image 61
jacob Avatar answered Sep 28 '22 08:09

jacob