2

I have my app stored on GitHub. To deploy it to Amazon, I use their EB deploy command which takes my git repository and sends it up. It then runs the container commands to load my data.

container_commands: 01_migrate: command: "django-admin.py migrate" leader_only: true 02_collectstatic: command: "source /opt/python/run/venv/bin/activate && python manage.py collectstatic --noinput"

The problem is that I don't want the fixtures in my git. Git should not contain this data since it's shared with other users. How can I get my AWS to load the fixtures some other way?

1 Answers1

0

You can use the old school way: scp to the ec2 instance.

You can go to the EC2 console to see the real EC2 instance associated to your EB environment (I assume you only have one instance). Write down the public ip, and then connect to the instance like you would do with a normal EC2 instance.

For example

scp -i [YOUR_AWS_KEY] [MY_FIXTURE_FILE] ec2-user@[INSTANCE_IP]:[PATH_ON_SERVER]

Note that the username has to be ec2-user.

But I do not recommend this way to deploy the project because you may need to manually execute the commands. This is, however, useful for me to get the fixture from a live server.

To avoid tracking fixtures in the git. I just use a simple workaround: create a local branch for EB deployment and track the fixtures along with other environment-specific credentials. Such EB branches should never be uploaded to the git remote repositories.