Django / Managed VM - Migrate DB with deploy

39 views
Skip to first unread message

Aaron Madison

unread,
Mar 31, 2016, 4:06:20 PM3/31/16
to Google App Engine
I'm looking to switch from AWS to GCP with Managed VMs, CloudSQL, and Django and have a question on deployment.

With our AWS Elastic beanstalk we include some config in out .ebextensions:

container_commands:

01_upgrade:
command: "/opt/python/run/venv/bin/pip install -r requirements.txt --upgrade"
02_syncdb:
command: "/opt/python/run/venv/bin/python manage.py syncdb --noinput"
leader_only: true
03_migrate:
command: "/opt/python/run/venv/bin/python manage.py migrate --noinput"
leader_only: true
04_collectstatic:
command: "/opt/python/run/venv/bin/python manage.py collectstatic --noinput"


Is there an equivalent when deploying with `gcloud preview app deploy`?

In the interim I've ran the migration connecting my machine to the remote database, but that can run very slow.

Thanks for any direction,

~ aaron

Adam (Cloud Platform Support)

unread,
Apr 2, 2016, 3:42:35 PM4/2/16
to Google App Engine
You can achieve the same thing using a Dockerfile on Managed VMs (now called App Engine Flexible Environment). Check out the example Dockerfile from the getting-started-django project, and the docs for Custom Runtimes for more info.
Reply all
Reply to author
Forward
0 new messages