<commit_before>#!/bin/bash
set -eu

image_id=$(buildkite-agent meta-data get image_id)
branch=$(git rev-parse --abbrev-ref HEAD)

echo "Publishing branch $branch"

cat << EOF > templates/mappings.yml
Mappings:
  AWSRegion2AMI:
    us-east-1     : { AMI: $image_id }
EOF

make setup build

if [[ $branch == "master" ]] ; then
	aws s3 cp --acl public-read templates/mappings.yml "s3://buildkite-aws-stack/mappings.yml"
	aws s3 cp --acl public-read build/aws-stack.json "s3://buildkite-aws-stack/aws-stack.json"
else
	aws s3 cp --acl public-read templates/mappings.yml "s3://buildkite-aws-stack/${branch}/mappings.yml"
	aws s3 cp --acl public-read build/aws-stack.json "s3://buildkite-aws-stack/${branch}/aws-stack.json"
fi<commit_msg>Use BUILDKITE_BRANCH vs git HEAD<commit_after>#!/bin/bash
set -eu

image_id=$(buildkite-agent meta-data get image_id)

echo "Publishing branch $BUILDKITE_BRANCH"

cat << EOF > templates/mappings.yml
Mappings:
  AWSRegion2AMI:
    us-east-1     : { AMI: $image_id }
EOF

make setup build

if [[ $BUILDKITE_BRANCH == "master" ]] ; then
	aws s3 cp --acl public-read templates/mappings.yml "s3://buildkite-aws-stack/mappings.yml"
	aws s3 cp --acl public-read build/aws-stack.json "s3://buildkite-aws-stack/aws-stack.json"
else
	aws s3 cp --acl public-read templates/mappings.yml "s3://buildkite-aws-stack/${BUILDKITE_BRANCH}/mappings.yml"
	aws s3 cp --acl public-read build/aws-stack.json "s3://buildkite-aws-stack/${BUILDKITE_BRANCH}/aws-stack.json"
fi
{'fraction_non_alphanumeric': 0.15259959486833222, 'fraction_numerical': 0.01350438892640108, 'mean_word_length': 3.9565217391304346, 'pattern_counts': {'":': 0, '<': 7, '<?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': '2073250', 'n_tokens_mistral': 585, 'n_tokens_neox': 571, 'n_words': 121}