<commit_before>#!/usr/bin/env bash

# Setup:
#   1) Install composer
#       $ mkdir ~/common
#       $ cd ~/common
#       $ curl -sS https://getcomposer.org/installer | /ramdisk/php/54/bin/php54-cli
#
# Deploy Process:
#    1) Pull latest changes from github
#       $ cd tmlpstats
#       $ git pull
#    2) Run deploy script
#       $ cd ..
#       $ ./deploy.sh
#
# Rollback Process:
#    1) Run deploy script with rollback option
#       $ ./deploy.sh rollback
#

SOURCE="$HOME/tmlpstats.git"
DEST="/var/www/tmlpstats.com"
ROLLBACK="$HOME/tmlpstats.rollback"

if [ "$1" == "rollback" ]; then
    rsync -av --delete $ROLLBACK/ $DEST
    exit 0;
fi

# Setup rollback copy
rm -rf $ROLLBACK
rsync -av $DEST/ $ROLLBACK

# Do actual deploy
echo ""
echo "Running composer"
cd $SOURCE/
composer install --no-dev --optimize-autoloader

echo ""
echo "Running migrations"
cd $DEST/
php artisan migrate

echo ""
echo "Syncing files"
rsync -av --delete --filter='protect .env' \
                   --filter='protect storage/framework/sessions/*' \
                   --filter='protect storage/logs/*' \
                   --filter='protect storage/app/*' \
                   --filter='protect public/error_log' \
                   --exclude='.git*' \
                   --exclude='composer.*' \<commit_msg>Quit rsync of rollback data<commit_after>#!/usr/bin/env bash

# Setup:
#   1) Install composer
#       $ mkdir ~/common
#       $ cd ~/common
#       $ curl -sS https://getcomposer.org/installer | /ramdisk/php/54/bin/php54-cli
#
# Deploy Process:
#    1) Pull latest changes from github
#       $ cd tmlpstats
#       $ git pull
#    2) Run deploy script
#       $ cd ..
#       $ ./deploy.sh
#
# Rollback Process:
#    1) Run deploy script with rollback option
#       $ ./deploy.sh rollback
#

SOURCE="$HOME/tmlpstats.git"
DEST="/var/www/tmlpstats.com"
ROLLBACK="$HOME/tmlpstats.rollback"

if [ "$1" == "rollback" ]; then
    rsync -av --delete $ROLLBACK/ $DEST
    exit 0;
fi

# Setup rollback copy
rm -rf $ROLLBACK
rsync -aq $DEST/ $ROLLBACK

# Do actual deploy
echo ""
echo "Running composer"
cd $SOURCE/
composer install --no-dev --optimize-autoloader

echo ""
echo "Running migrations"
cd $DEST/
php artisan migrate

echo ""
echo "Syncing files"
rsync -av --delete --filter='protect .env' \
                   --filter='protect storage/framework/sessions/*' \
                   --filter='protect storage/logs/*' \
                   --filter='protect storage/app/*' \
                   --filter='protect public/error_log' \
                   --exclude='.git*' \
                   --exclude='composer.*' \
{'fraction_non_alphanumeric': 0.14755351681957188, 'fraction_numerical': 0.00764525993883792, 'mean_word_length': 2.089728453364817, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '2428646', 'n_tokens_mistral': 903, 'n_tokens_neox': 858, 'n_words': 222}