首页 > 解决方案 > Elasticbeanstalk Django issues with ondeck vs current version

问题描述

Using Elasticbeanstalk to deploy a Django application. Within the .ebextensions directory I've got the following (this is just a subset):

commands:
    00_pip_upgrade:
        command: /opt/python/run/venv/bin/pip install --upgrade pip
        leader_only: true

    01_pip_install:
        command: /opt/python/run/venv/bin/pip install -r /opt/python/ondeck/app/requirements.txt
        leader_only: true

container_commands:
    111_collectstatic:
        command: "source /opt/python/run/venv/bin/activate && python /opt/python/ondeck/app/manage.py collectstatic --noinput"
        leader_only: true 

The issue is that anything with ondeck isn't found. I am having trouble finding AWS documentation regarding the transitions between bundle, ondeck, and current directories. When I ssh into the instances I don't see any directory at all for /opt/python/ondeck.

Can someone help to explain if /opt/python/ondeck should still be used or what my issues may be?

标签: djangoamazon-elastic-beanstalk

解决方案


Well after speaking with AWS support I have a little more information. My inability to find any documentation regarding /opt/python/ondeck is because each EB could use different paths based on the its settings. If you need help understanding the directories in your current situation, checkout cloudformation. Additional important information:

  1. The commands section of .ebextensions will not have access to the staging (new deployment code) because it exists before it
  2. The container_commands will have access to staging code so I needed to move some items here. For me /opt/python/ondeck worked as expected within this section.

推荐阅读