3

This is my first python-Flask app on AWS. It has caused headaches.

The procedure that I have followed is:

mkdir myapp && cd myapp
virtualenv venv
source venv/bin/activate
pip install Flask SQLAlchemy twilio psycopg2 
pip freeze > requirements.txt
mkdir .ebextensions
cd .ebxtensions
nano application.config #content of this file below
packages:
  yum:
    postgresql93-devel: []

option_settings:
  - option_name: MANDRILL_APIKEY
    value: my_value
  - option_name: MANDRILL_USERNAME
    value: my_email_address
cd ..
deactivate
eb init
eb create

After a whole range of problems, including with options settings and psycopg2, the above worked.

Now the issue is how to update when I make changes to the app on my local machine. I have tried as follows:

git init
eb init
git add .
git commit -m "my first update"
git aws.push

which does not work and returns error message saying that "git aws.push" is not a legal command (or something like that). I have also tried "eb push".

So 2 questions here:

  1. Why is the above procedure with git failing?
  2. What is the correct way to push updates or changes to elastic beanstalk?

Thank you, all help gratefully received.

silpol
  • 302
  • 11
  • 27
user1903663
  • 1,393
  • 2
  • 17
  • 36

1 Answers1

6

If you're using the most recent (3+) release of the Elastic Beanstalk command line tool, the way to push updates is "eb deploy". Earlier versions used "eb push".

manychairs
  • 149
  • 3
  • BUT every time I run eb deploy I loose my local db (created in sqlite for my flask app). How can I prevent loosing my db? – erickfis Dec 09 '18 at 18:41