<commit_before>#!/bin/sh
#
# A little helper script for an awsbox to auto-update itself.
# This script will pull updates from the origin repo, update local master
# to match them, and initiate the post-deploy hooks.  If you run it as
# a cronjob then you'll get an auto-updating awsbox deployment.
# Like this:
#
#  echo "*/5 * * * * /bin/bash -l /home/app/code/scripts/awsbox/auto_update.sh > /dev/null 2> /dev/null" | sudo crontab -u app -

set -e

CURCOMMIT="git log --pretty=%h -1"
ORIGIN="https://github.com/mozilla/fxa-content-server.git"

cd /home/app/git
git remote add origin $ORIGIN || true
git fetch origin

if [ `$CURCOMMIT master` != `$CURCOMMIT origin/master` ]; then
  git branch -f master origin/master
  /usr/local/bin/node ../post-update.js
fi<commit_msg>Cleanup build tempfiles in auto-update script.<commit_after>#!/bin/sh
#
# A little helper script for an awsbox to auto-update itself.
# This script will pull updates from the origin repo, update local master
# to match them, and initiate the post-deploy hooks.  If you run it as
# a cronjob then you'll get an auto-updating awsbox deployment.
# Like this:
#
#  echo "*/5 * * * * /bin/bash -l /home/app/code/scripts/awsbox/auto_update.sh > /dev/null 2> /dev/null" | sudo crontab -u app -

set -e

CURCOMMIT="git log --pretty=%h -1"
ORIGIN="https://github.com/mozilla/fxa-content-server.git"

cd /home/app/git
git remote add origin $ORIGIN || true
git fetch origin

if [ `$CURCOMMIT master` != `$CURCOMMIT origin/master` ]; then
  git branch -f master origin/master
  /usr/local/bin/node ../post-update.js
fi

rm -rf /home/app/tmp/*
{'fraction_non_alphanumeric': 0.132252027448534, 'fraction_numerical': 0.0037429819089207735, 'mean_word_length': 3.467966573816156, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '6513879', 'n_tokens_mistral': 570, 'n_tokens_neox': 551, 'n_words': 189}