<commit_before># -*- mode: ruby -*-
# vi: set ft=ruby :

# requires vagrant-triggers
# requires vagrant-hostmanager

script = <<SCRIPT
mkdir -p -m0775 /var/www/mddd
cd /var/www/mddd

if ! git rev-parse --git-dir > /dev/null 2>&1; then
    git init
    git remote add origin https://github.com/dwalkr/mddd.git
    git fetch
    git checkout -t origin/master
else
    git pull
fi

sudo chown -R vagrant:vagrant /var/www/mddd

cd ~

echo "Listen 8999
<VirtualHost *:8999>
    UseCanonicalName Off
    DocumentRoot /var/www/mddd
    <Directory /var/www/mddd>
        Options FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>" > /etc/apache2/sites-available/mddd.conf

sudo a2ensite mddd
sudo service apache2 restart

SCRIPT

Vagrant.configure("2") do |config|
    
    # provision: add datamanager :8999 to apache VHost
    # provision: clone latest version of datamanager
    config.vm.provision "shell", inline: script
    
    config.trigger.after [:up, :reload] do
        run_remote "echo 'Magnificent Downstream Data Dumper is alive and well on port :8999'"
    end
end<commit_msg>put datamanager in a different dir<commit_after># -*- mode: ruby -*-
# vi: set ft=ruby :

# requires vagrant-triggers
# requires vagrant-hostmanager

script = <<SCRIPT
mkdir -p -m0775 /etc/dwalkr/mddd
cd /etc/dwalkr/mddd

if ! git rev-parse --git-dir > /dev/null 2>&1; then
    git init
    git remote add origin https://github.com/dwalkr/mddd.git
    git fetch
    git checkout -t origin/master
else
    git pull
fi

sudo chown -R vagrant:vagrant /etc/dwalkr/mddd

cd ~

echo "Listen 8999
<VirtualHost *:8999>
    UseCanonicalName Off
    DocumentRoot /etc/dwalkr/mddd
    <Directory /etc/dwalkr/mddd>
        Options FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>" > /etc/apache2/sites-available/mddd.conf

sudo a2ensite mddd
sudo service apache2 restart

SCRIPT

Vagrant.configure("2") do |config|
    
    # provision: add datamanager :8999 to apache VHost
    # provision: clone latest version of datamanager
    config.vm.provision "shell", inline: script
    
    config.trigger.after [:up, :reload] do
        run_remote "echo 'Magnificent Downstream Data Dumper is alive and well on port :8999'"
    end
end
{'fraction_non_alphanumeric': 0.09809027777777778, 'fraction_numerical': 0.022569444444444444, 'mean_word_length': 2.9878892733564015, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 17, 'https://': 2, 'lorem ipsum': 0, 'www.': 5, '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': '6164315', 'n_tokens_mistral': 834, 'n_tokens_neox': 781, 'n_words': 236}