<commit_before>#!/bin/bash

set -e

# Add production git remote if required
PROD_TEST=`git remote | grep -s 'production' || true`
if [[ "$PROD_TEST" != *production* ]]; then
    git remote add production ubuntu@ofn-prod:apps/openfoodweb/current
fi

echo "--- Saving baseline data for staging"
ssh ofn-staging2 "/home/openfoodweb/apps/openfoodweb/current/script/ci/save_staging_baseline.sh `get_ofn_commit`"

echo "--- Pushing to production"
exec 5>&1
OUTPUT=$(git push production `get_ofn_commit`:master --force 2>&1 |tee /dev/fd/5)
[[ $OUTPUT =~ "Done" ]]<commit_msg>Fix push to production - needs includes for get_ofn_commit<commit_after>#!/bin/bash

set -e
source ./script/ci/includes.sh

# Add production git remote if required
PROD_TEST=`git remote | grep -s 'production' || true`
if [[ "$PROD_TEST" != *production* ]]; then
    git remote add production ubuntu@ofn-prod:apps/openfoodweb/current
fi

echo "--- Saving baseline data for staging"
ssh ofn-staging2 "/home/openfoodweb/apps/openfoodweb/current/script/ci/save_staging_baseline.sh `get_ofn_commit`"

echo "--- Pushing to production"
exec 5>&1
OUTPUT=$(git push production `get_ofn_commit`:master --force 2>&1 |tee /dev/fd/5)
[[ $OUTPUT =~ "Done" ]]
{'fraction_non_alphanumeric': 0.14521452145214522, 'fraction_numerical': 0.009900990099009901, 'mean_word_length': 4.748815165876778, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '3374451', 'n_tokens_mistral': 435, 'n_tokens_neox': 410, 'n_words': 111}