Last active
February 8, 2018 22:32
-
-
Save ferociouself/900ffa1ca22561d7351644bd5823aafd to your computer and use it in GitHub Desktop.
Scripts that allow CodeDeploy to deploy Django code. Replace "project" with your project name, and "app_name" with the name of your app.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
rm -rf /var/www/html/* | |
rm -rf /home/ec2-user/www/* | |
rm -rf /home/ec2-user/installation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
yum install -y python34 | |
yum install -y python-psycopg2 postgresql libncurses5-dev libffi libffi-devel libxml2-devel libxslt-devel libxslt1-dev | |
yum install -y postgresql-libs postgresql-devel python-lxml python-devel gcc patch python-setuptools |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
source /home/ec2-user/www/venv/bin/activate | |
/home/ec2-user/www/venv/bin/pip3 install -r /var/www/html/requirements.txt | |
/home/ec2-user/www/venv/bin/pip3 install psycopg2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
python3 -m venv /home/ec2-user/www/venv --without-pip | |
source /home/ec2-user/www/venv/bin/activate | |
mkdir /home/ec2-user/installation/ | |
cd /home/ec2-user/installation/ | |
wget https://bootstrap.pypa.io/get-pip.py | |
python get-pip.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
cd /var/www/html/project/ | |
source /home/ec2-user/www/venv/bin/activate | |
python3 ./manage.py makemigrations | |
python3 ./manage.py makemigrations app_name | |
python3 ./manage.py migrate | |
python3 ./manage.py migrate app_name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
cd /var/www/html/project/ | |
source /home/ec2-user/www/venv/bin/activate | |
python3 ./manage.py collectstatic --noinput --clear |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment