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

set -eux

CRONDIR=$(pwd)/crondir
mkdir -p $CRONDIR
source aws.sh

IMAGE=fpco/stackage-server-prod:latest
docker pull $IMAGE

stack update

echo "Running stackage-server-cron..."
echo "('tail -f $CRONDIR/stackage-server-cron.log' to watch)"
docker run --rm \
    -v $CRONDIR:/home/ubuntu \
    -v $HOME/.stack:/home/ubuntu/.stack:ro \
    $IMAGE \
    bash -c "useradd $(whoami) -u $(id -u); sudo -u $(whoami) env HOME=/home/ubuntu AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY bash -c '/usr/local/bin/stackage-server-cron 2>&1 | tee -a /home/ubuntu/stackage-server-cron.log'"
<commit_msg>Fix a buggy shell script<commit_after>#!/usr/bin/env bash

set -eux

CRONDIR=$(pwd)/crondir
mkdir -p $CRONDIR
source aws.sh

IMAGE=fpco/stackage-server-prod:latest
docker pull $IMAGE

stack update

echo "Running stackage-server-cron..."
echo "('tail -f $CRONDIR/stackage-server-cron.log' to watch)"
docker run --rm \
    -v $CRONDIR:/home/ubuntu \
    -v $HOME/.stack/indices:/home/ubuntu/.stack/indices:ro \
    --workdir /home/ubuntu \
    $IMAGE \
    bash -c "useradd $(whoami) -u $(id -u); sudo -u $(whoami) env HOME=/home/ubuntu AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY bash -c '/usr/local/bin/stackage-server-cron 2>&1 | tee -a /home/ubuntu/stackage-server-cron.log'"

{'fraction_non_alphanumeric': 0.15915697674418605, 'fraction_numerical': 0.0029069767441860465, 'mean_word_length': 3.731958762886598, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '7011491', 'n_tokens_mistral': 582, 'n_tokens_neox': 537, 'n_words': 114}