<commit_before>#!/bin/bash

stability=$1

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

# ensure the build dir exists
mkdir -p $project_dir/.build

echo "Generating tarball..."
tar -cvz -C $project_dir/src -f $project_dir/.build/mysql-${stability}.tgz .

echo "Generating md5..."
cat $project_dir/.build/mysql-${stability}.tgz | md5 > $project_dir/.build/mysql-${stability}.md5

echo "Uploading builds to s3..."
aws s3 sync \
  $project_dir/.build/ \
  s3://tools.nanobox.io/hooks \
  --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers \
  --region us-east-1

echo "Cleaning..."
rm -rf $project_dir/.build
<commit_msg>add step to publishing to invalidate cache on cloudfront<commit_after>#!/bin/bash

stability=$1

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

# ensure the build dir exists
mkdir -p $project_dir/.build

echo "Generating tarball..."
tar -cvz -C $project_dir/src -f $project_dir/.build/mysql-${stability}.tgz .

echo "Generating md5..."
cat $project_dir/.build/mysql-${stability}.tgz | md5 > $project_dir/.build/mysql-${stability}.md5

echo "Uploading builds to s3..."
aws s3 sync \
  $project_dir/.build/ \
  s3://tools.nanobox.io/hooks \
  --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers \
  --region us-east-1

echo "Creating invalidation for cloudfront"
aws  configure  set preview.cloudfront true
aws cloudfront create-invalidation \
  --distribution-id E1O0D0A2DTYRY8 \
  --paths /hooks/mysql-${stability}.tgz /hooks/mysql-${stability}.md5

echo "Cleaning..."
rm -rf $project_dir/.build

{'fraction_non_alphanumeric': 0.17420537897310515, 'fraction_numerical': 0.014669926650366748, 'mean_word_length': 3.915915915915916, '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': '1405859', 'n_tokens_mistral': 600, 'n_tokens_neox': 583, 'n_words': 128}