<commit_before>#!/bin/bash

RELEASE=${RELEASE-latest}
if [[ $RELEASE =~ ^[a-fA-F0-9]{40}$ ]]
then
  # IF $RELEASE is a committish, use the first seven characters
  RELEASE=$(echo $RELEASE | awk '{print substr($0,0,7)}')
fi

docker run --rm -v /var/run/docker.sock:/var/run/docker.sock \
  -v ${PATH_TO_CODE}:/build \
  -e APPLICATION_SLUG=${APPLICATION_SLUG} \
  -e RELEASE=${RELEASE} \
  -it soapbox

# Upload "latest" archive
echo 'aws s3 cp ${PATH_TO_CODE}/${APPLICATION_SLUG}-latest.tar.gz \
  s3://${S3_BUCKET-soapbox-app-images}/${APPLICATION_SLUG}/${APPLICATION_SLUG}-latest.tar.gz'

if [[ "$RELEASE" != "latest" ]]
then
  # Upload the archive with $RELEASE in filename
  echo 'aws s3 cp ${PATH_TO_CODE}/${APPLICATION_SLUG}-${RELEASE}.tar.gz \
    s3://${S3_BUCKET-soapbox-app-images}/${APPLICATION_SLUG}/${APPLICATION_SLUG}-${RELEASE}.tar.gz'
fi<commit_msg>Simplify making a substring<commit_after>#!/bin/bash

RELEASE=${RELEASE-latest}
if [[ $RELEASE =~ ^[a-fA-F0-9]{40}$ ]]
then
  # IF $RELEASE is a committish, use the first seven characters
  RELEASE=${RELEASE:0:7}
fi

docker run --rm -v /var/run/docker.sock:/var/run/docker.sock \
  -v ${PATH_TO_CODE}:/build \
  -e APPLICATION_SLUG=${APPLICATION_SLUG} \
  -e RELEASE=${RELEASE} \
  -it soapbox

# Upload "latest" archive
echo 'aws s3 cp ${PATH_TO_CODE}/${APPLICATION_SLUG}-latest.tar.gz \
  s3://${S3_BUCKET-soapbox-app-images}/${APPLICATION_SLUG}/${APPLICATION_SLUG}-latest.tar.gz'

if [[ "$RELEASE" != "latest" ]]
then
  # Upload the archive with $RELEASE in filename
  echo 'aws s3 cp ${PATH_TO_CODE}/${APPLICATION_SLUG}-${RELEASE}.tar.gz \
    s3://${S3_BUCKET-soapbox-app-images}/${APPLICATION_SLUG}/${APPLICATION_SLUG}-${RELEASE}.tar.gz'
fi
{'fraction_non_alphanumeric': 0.18994739918176504, 'fraction_numerical': 0.014611338398597311, 'mean_word_length': 4.400630914826499, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3987957', 'n_tokens_mistral': 709, 'n_tokens_neox': 658, 'n_words': 122}