<commit_before># This script will deploy the latest code to production.
# This script should NOT be used if there are database migrations involved.
# Make sure this script is in "/home/sigmapiwpi/deploy" on the WebFaction server before running.

echo 'Creating backup of current deploy...' &&
rm -rf /home/sigmapiwpi/deploy/backup && mkdir /home/sigmapiwpi/deploy/backup &&
cp -r /home/sigmapiwpi/webapps/sigma_pi_web/SigmaPi /home/sigmapiwpi/webapps/sigma_pi_web_static /home/sigmapiwpi/deploy/backup &&

echo 'Cloning Github repository...' &&
rm -rf /home/sigmapiwpi/deploy/sigmapi-web &&
git clone https://github.com/austintrose/sigmapi-web.git /home/sigmapiwpi/deploy/sigmapi-web;

echo 'Deploying site...' &&
rm -rf /home/sigmapiwpi/webapps/sigma_pi_web/SigmaPi &&
cp -r /home/sigmapiwpi/deploy/sigmapi-web/SigmaPi /home/sigmapiwpi/webapps/sigma_pi_web &&
rm -rf /home/sigmapiwpi/webapps/sigma_pi_web_static/* &&
cp -r /home/sigmapiwpi/deploy/sigmapi-web/SigmaPi/static/* /home/sigmapiwpi/webapps/sigma_pi_web_static &&
rm -rf /home/sigmapiwpi/webapps/sigma_pi_web/SigmaPi/static &&
cp -r /home/sigmapiwpi/webapps/sigma_pi_web/lib/python2.7/django/contrib/admin/static/admin /home/sigmapiwpi/webapps/sigma_pi_web_static/ &&

echo 'Copying production settings file...' &&
rm -rf /home/sigmapiwpi/webapps/sigma_pi_web/SigmaPi/SigmaPi/settings.py &&
cp /home/sigmapiwpi/deploy/production_settings.py /home/sigmapiwpi/webapps/sigma_pi_web/SigmaPi/SigmaPi/settings.py &&

echo 'Installing Python dependencies...' &&
pip2.7 install --user -r /home/sigmapiwpi/webapps/sigma_pi_web/SigmaPi/requirements.txt &&
python2.7 /home/sigmapiwpi/webapps/sigma_pi_web/SigmaPi/manage.py syncdb &&
python2.7 /home/sigmapiwpi/webapps/sigma_pi_web/SigmaPi/manage.py migrate &&

echo 'Restarting server...' &&
/home/sigmapiwpi/webapps/sigma_pi_web/apache2/bin/restart &&

echo 'Deploy was successfull!';<commit_msg>Fix deploy script<commit_after># This script will deploy the latest code to production.
# This script should NOT be used if there are database migrations involved.

echo 'Creating backup of current deploy...' &&
rm -rf ~/deploy/backup && mkdir ~/deploy/backup;
cp -r ~/webapps/sigma_pi_web/SigmaPi ~/webapps/sigma_pi_web_static ~/deploy/backup;

echo 'Cloning Github repository...' &&
rm -rf ~/deploy/sigmapi-web &&
git clone https://github.com/austintrose/sigmapi-web.git ~/deploy/sigmapi-web;

echo 'Deploying site...' &&
rm -rf ~/webapps/sigma_pi_web/SigmaPi &&
cp -r ~/deploy/sigmapi-web/SigmaPi ~/webapps/sigma_pi_web &&
rm -rf ~/webapps/sigma_pi_web_static/* &&
cp -r ~/deploy/sigmapi-web/SigmaPi/static/* ~/webapps/sigma_pi_web_static &&
rm -rf ~/webapps/sigma_pi_web/SigmaPi/static &&
cp -r ~/webapps/sigma_pi_web/lib/python2.7/django/contrib/admin/static/admin ~/webapps/sigma_pi_web_static/ &&

echo 'Copying production settings file...' &&
rm -rf ~/webapps/sigma_pi_web/SigmaPi/SigmaPi/settings.py &&
cp ~/deploy/production_settings.py ~/webapps/sigma_pi_web/SigmaPi/SigmaPi/settings.py &&

echo 'Installing Python dependencies...' &&
pip2.7 install --user -r ~/webapps/sigma_pi_web/SigmaPi/requirements.txt &&
python2.7 ~/webapps/sigma_pi_web/SigmaPi/manage.py syncdb &&
python2.7 ~/webapps/sigma_pi_web/SigmaPi/manage.py migrate &&

echo 'Restarting server...' &&
~/webapps/sigma_pi_web/apache2/bin/restart &&

echo 'Deploy was successfull!';
{'fraction_non_alphanumeric': 0.14200477326968974, 'fraction_numerical': 0.0053699284009546535, 'mean_word_length': 4.5790349417637275, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1934796', 'n_tokens_mistral': 1237, 'n_tokens_neox': 1212, 'n_words': 228}