<commit_before>#!/bin/sh
if id -un | grep -q root ; then
    echo switching to starshine user
    exec sudo -u starshine sh $0 $*
fi
if ! id -un | grep -q starshine ; then
    echo Error: you must be starshine
    exit 1
fi

if [ -z "$1" ] ; then
		target=master
else
		target="$1"
fi

REPO=/srv/starshine-data/git_repo/Starshine-Online
PROD=/srv/starshine-data/starshine/starshine071

if [ -f /home/starshine/config.sh ] ; then
	. /home/starshine/config.sh
fi

set -x

cd $REPO
git fetch origin '+refs/heads/*:refs/heads/*' || exit 1
git reset --soft master || exit 1
git archive $target | tar -x -C $PROD
chmod g+w $PROD/arenes/ $PROD/arenes/admin/

cd $PROD/sql
php db_check_auto_maj.php
exit 0
<commit_msg>version.txt<commit_after>#!/bin/sh
if id -un | grep -q root ; then
    echo switching to starshine user
    exec sudo -u starshine sh $0 $*
fi
if ! id -un | grep -q starshine ; then
    echo Error: you must be starshine
    exit 1
fi

if [ -z "$1" ] ; then
		target=master
else
		target="$1"
fi

REPO=/srv/starshine-data/git_repo/Starshine-Online
PROD=/srv/starshine-data/starshine/starshine071

if [ -f /home/starshine/config.sh ] ; then
	. /home/starshine/config.sh
fi

set -x

cd $REPO
git fetch origin '+refs/heads/*:refs/heads/*' || exit 1
git reset --soft master || exit 1
git archive $target | tar -x -C $PROD
git log | head -1 | cut -d\  -f2 > $PROD/version.txt
chmod g+w $PROD/arenes/ $PROD/arenes/admin/

cd $PROD/sql
php db_check_auto_maj.php
exit 0

{'fraction_non_alphanumeric': 0.13392250169952413, 'fraction_numerical': 0.01495581237253569, 'mean_word_length': 3.021857923497268, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '1494244', 'n_tokens_mistral': 611, 'n_tokens_neox': 596, 'n_words': 178}