-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fixup the provisioning scripts and add a section for a clean ubuntu…
… 16.04 machine.
- Loading branch information
Showing
10 changed files
with
56 additions
and
24 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Migrate the database | ||
source $HOME/.bashrc | ||
source $HOME/.virtualenvs/kala/bin/activate | ||
cd /srv/$PROJECT-app/django_$PROJECT | ||
python3 manage.py migrate | ||
|
||
# Create a new secret key | ||
python -c "from django.core.management.utils import get_random_secret_key; print('env = SECRET_KEY={0}'.format(get_random_secret_key()));" >> /etc/uwsgi/apps-available/$PROJECT_URL.ini | ||
|
||
cat >> $HOME/.bashrc <<- EOM | ||
export DEPLOYMENT_ENVIRONMENT=$DEPLYOMENT | ||
export DATABASE_USER=$DATABASE_USER | ||
export DATABASE_PASSWORD=$DATABASE_PASSWORD | ||
export DATABASE_NAME=$DATABASE_NAME | ||
export DATABASE_HOST=$DATABASE_HOST | ||
export HOST_NAME=$HOST_NAME | ||
EOM | ||
|
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env bash | ||
|
||
export PROJECT=kala | ||
export PROJECT_URL=`curl -s http://169.254.169.254/latest/meta-data/public-hostname` | ||
export HOME=/home/ubuntu | ||
export DEPLOYMENT=dev | ||
export WORKING_DIR=/srv/kala-app | ||
export DATABASE_USER=kala | ||
export DATABASE_PASSWORD=`openssl rand -base64 32` | ||
export DATABASE_NAME=kala | ||
export DATABASE_HOST=localhost | ||
export HOST_NAME=$PROJECT_URL | ||
|
||
bash $WORKING_DIR/deploy/provision/provision.sh | ||
|
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,10 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Make it so pip does not complain if pip is an older version. | ||
pip install -U pip | ||
sudo pip3 install -U pip virtualenv | ||
|
||
# Create the virtualenv | ||
pip install virtualenv | ||
virtualenv -p /usr/bin/python3 /home/vagrant/.virtualenvs/$PROJECT | ||
source /home/vagrant/.virtualenvs/$PROJECT/bin/activate | ||
pip install -r /srv/$PROJECT-app/requirements-dev.txt | ||
chown -R vagrant:vagrant /home/vagrant/.virtualenvs/$PROJECT | ||
|
||
# Migrate the database | ||
source /home/vagrant/.zshrc | ||
cd /srv/$PROJECT-app/django_$PROJECT | ||
python3 manage.py migrate | ||
|
||
# Create a new secret key | ||
python -c "from django.core.management.utils import get_random_secret_key; print('env = SECRET_KEY={0}'.format(get_random_secret_key()));" >> /etc/uwsgi/apps-available/$PROJECT_URL.ini |