The production environment is broken out into a few directories
versions
myxer
vx.x.x
production
settings.py
- versions - hosts the versioned archives of the myxer github repository
- production - symlink to the live version of the myxer codebase
- settings.py - production environment settings
cd /var/www/myxer.com/versions/myxer
git pull origin master
First we need to pull the latest iteration of the site before we can archive it out
mkdir ../vx.y.z
git archive master | tar -xC ../vx.y.z
Increment the version number according to the release tag in git or use the following iteration rules.
Iteration Rules:
- x: Major Version - Generally only changes for large codebase changes.
- y: Database Change Version - If you push an update that changes the database increment this.
- z: Bug Fix Version - If you're pushing a bug fix or feature that doesn't change the database increment this.
cd ../vx.y.z/myxer/settings
ln -s /var/www/myxer.com/settings.py local.py
cd ../../ && python manage.py collectstatic
All the settings are pulling from the common.py however the common.py looks for a file called local.py to include environment specific settings.
It is good practice to not store senensitve setting information inside the repository. This is the reasoning behind symlinking to settings.py to local.py where settings.py is outside of the myxer codebase.