<commit_before>#!/bin/bash -eux

WD=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)

. "${WD}/p4d/default"

wget -q http://package.perforce.com/perforce.pubkey -O - | apt-key add -
cat > /etc/apt/sources.list.d/perforce.sources.list << MUFASA
deb http://package.perforce.com/apt/ubuntu precise release 
MUFASA

apt-get update
apt-get install -qq perforce-swarm perforce-swarm-triggers

su - vagrant -c "p4 user -i -f << MUFASA
User: $SWARMUSER
Password: <PASSWORD>
Email: <EMAIL>
FullName: swarm
MUFASA"
(cd /home/vagrant && \
su - vagrant -c 'p4 protect -o > add' && \
sed -i '$d' add && \
echo -e "\tadmin user $SWARMUSER * //..." >> add && \
su - vagrant -c 'p4 protect -i < add' && \
rm add)

/opt/perforce/swarm/sbin/configure-swarm.sh -p $P4PORT -u $SWARMUSER -w $SWARMPASSWD -U $P4USER -W $P4PASSWD -e $(hostname) -H $(hostname -f)

curl -sS http://localhost/login -c cookie -d "user=${P4USER}&password=${<PASSWORD>}" -o /dev/null
token=$(curl -sS http://localhost/about -b cookie | sed -nr 's#^.*token muted.*value="(.+)".*$#\1#p')
rm cookie
(cd /opt/perforce/etc && \
sed -i 's#^\(SWARM_HOST\s*=\s*\).*$#\1"http://'"$(hostname -f)"'"#' swarm-trigger.conf && \
sed -i 's#^\(SWARM_TOKEN\s*=\s*\).*$#\1"'$token'"#' swarm-trigger.conf)<commit_msg>fix trigger resolution, disable apache default site<commit_after>#!/bin/bash -eux

WD=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)

. "${WD}/p4d/default"

wget -q http://package.perforce.com/perforce.pubkey -O - | apt-key add -
cat > /etc/apt/sources.list.d/perforce.sources.list << MUFASA
deb http://package.perforce.com/apt/ubuntu precise release 
MUFASA

apt-get update
apt-get install -qq perforce-swarm perforce-swarm-triggers

su - vagrant -c "p4 user -i -f << MUFASA
User: $SWARMUSER
Password: <PASSWORD>
Email: swarm@priderock
FullName: swarm
MUFASA"
(cd /home/vagrant && \
su - vagrant -c 'p4 protect -o > add' && \
sed -i '$d' add && \
echo -e "\tadmin user $SWARMUSER * //..." >> add && \
su - vagrant -c 'p4 protect -i < add' && \
rm add)

/opt/perforce/swarm/sbin/configure-swarm.sh -p $P4PORT -u $SWARMUSER -w $SWARMPASSWD -U $P4USER -W $P4PASSWD -e $(hostname) -H $(hostname -f)

curl -sS http://localhost/login -c cookie -d "user=${P4USER}&password=${P4PASSWD}" -o /dev/null
token=$(curl -sS http://localhost/about -b cookie | sed -nr 's#^.*token muted.*value="(.+)".*$#\1#p')
rm cookie
(cd /opt/perforce/etc && \
sed -i 's#^\(SWARM_HOST\s*=\s*\).*$#\1"http://'"$(hostname -f)"'"#' swarm-trigger.conf && \
sed -i 's#^\(SWARM_TOKEN\s*=\s*\).*$#\1"'$token'"#' swarm-trigger.conf && \
echo "localhost" >> swarm-cron-hosts.conf)

a2dissite 000-default
service apache2 reload
{'fraction_non_alphanumeric': 0.2241183162684869, 'fraction_numerical': 0.011376564277588168, 'mean_word_length': 3.5017064846416384, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, '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': '4464189', 'n_tokens_mistral': 1137, 'n_tokens_neox': 1085, 'n_words': 253}