<commit_before>#!/bin/bash -Eeu

#- - - - - - - - - - - - - - - - - - - - - - - -
build_tagged_images()
{
  build_images
  tag_images
  check_embedded_env_var
  echo
  echo "echo CYBER_DOJO_RUNNER_TAG=$(image_tag)"
  echo "echo CYBER_DOJO_RUNNER_SHA=$(image_sha)"
}

#- - - - - - - - - - - - - - - - - - - - - - - -
build_images()
{
  augmented_docker_compose \
    build \
    --build-arg COMMIT_SHA=$(git_commit_sha)
}

#- - - - - - - - - - - - - - - - - - - - - - - -
tag_images()
{
  docker tag ${CYBER_DOJO_RUNNER_IMAGE}:$(image_tag)        ${CYBER_DOJO_RUNNER_IMAGE}:latest
  docker tag ${CYBER_DOJO_RUNNER_CLIENT_IMAGE}:$(image_tag) ${CYBER_DOJO_RUNNER_CLIENT_IMAGE}:latest
}

# - - - - - - - - - - - - - - - - - - - - - -
check_embedded_env_var()
{
  if [ "$(git_commit_sha)" != "$(sha_in_image)" ]; then
    echo "ERROR: unexpected env-var inside image $(image_name):$(image_tag)"
    echo "expected: 'SHA=$(git_commit_sha)'"
    echo "  actual: 'SHA=$(sha_in_image)'"
    exit 42
  fi
}<commit_msg>Tidied build script output.<commit_after>#!/bin/bash -Eeu

#- - - - - - - - - - - - - - - - - - - - - - - -
build_tagged_images()
{
  build_images
  tag_images
  check_embedded_env_var
  echo
  echo "echo CYBER_DOJO_RUNNER_TAG=$(image_tag)"
  echo "echo CYBER_DOJO_RUNNER_SHA=$(image_sha)"
  echo
}

#- - - - - - - - - - - - - - - - - - - - - - - -
build_images()
{
  augmented_docker_compose \
    build \
    --build-arg COMMIT_SHA=$(git_commit_sha)
}

#- - - - - - - - - - - - - - - - - - - - - - - -
tag_images()
{
  docker tag ${CYBER_DOJO_RUNNER_IMAGE}:$(image_tag)        ${CYBER_DOJO_RUNNER_IMAGE}:latest
  docker tag ${CYBER_DOJO_RUNNER_CLIENT_IMAGE}:$(image_tag) ${CYBER_DOJO_RUNNER_CLIENT_IMAGE}:latest
}

# - - - - - - - - - - - - - - - - - - - - - -
check_embedded_env_var()
{
  if [ "$(git_commit_sha)" != "$(sha_in_image)" ]; then
    echo "ERROR: unexpected env-var inside image $(image_name):$(image_tag)"
    echo "expected: 'SHA=$(git_commit_sha)'"
    echo "  actual: 'SHA=$(sha_in_image)'"
    exit 42
  fi
}
{'fraction_non_alphanumeric': 0.20569464899361806, 'fraction_numerical': 0.0019636720667648502, 'mean_word_length': 2.174454828660436, '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': 24, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4860619', 'n_tokens_mistral': 863, 'n_tokens_neox': 837, 'n_words': 100}