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

declare -a tags
declare registry image_base

# Set built image base name
if [ "${TRAVIS_BRANCH}" = "master" ] && [ "${TRAVIS_TAG}" ]; then
  registry="${DOCKER_REGISTRY}"
  image_base="${DOCKER_REGISTRY}/${IMAGE_NAME}"
elif [ "${DOCKER_REGISTRY_DEV}" ]; then
  registry="${DOCKER_REGISTRY_DEV}"
  image_base="${DOCKER_REGISTRY_DEV}/${IMAGE_NAME}"
else
  echo "DOCKER_REGISTRY_DEV not set for a non release image, exiting."
  exit 1
fi

# Log in to registry
if [ "${registry}" ]; then
  docker login -e="${DOCKER_EMAIL}" -u="${DOCKER_USERNAME}" -p="${DOCKER_PASSWORD}" ${registry}
else
  echo "Docker registry failed to set properly, exiting."
  exit 1
fi

# Pull requests (image:commit-branch-pr-prnum)
if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then
  tags+=("${image_base}:${TRAVIS_COMMIT}-${TRAVIS_BRANCH}-pr-${TRAVIS_PULL_REQUEST}")
fi

# If commit tagged in master, tag as version and latest
if [ "${TRAVIS_BRANCH}" = "master" ] && [ "${TRAVIS_TAG}" ]; then
  tags+=("${image_base}:${TRAVIS_TAG}")
  tags+=("${image_base}:latest")
else
  tags+=("${image_base}:${TRAVIS_COMMIT}-${TRAVIS_BRANCH}")
fi

# Tag and push all image tags
for tag in ${tags[@]}; do
  docker tag ${IMAGE_NAME}:${TRAVIS_COMMIT} ${tag}
done

# Push images (may add branch criteria in the future)
for tag in ${tags[@]}; do
  docker push ${tag}
done<commit_msg>Added exec for docker commands<commit_after>#!/bin/bash
set -ev

declare -a tags
declare registry image_base

# Set built image base name
if [ "${TRAVIS_BRANCH}" = "master" ] && [ "${TRAVIS_TAG}" ]; then
  registry="${DOCKER_REGISTRY}"
  image_base="${DOCKER_REGISTRY}/${IMAGE_NAME}"
elif [ "${DOCKER_REGISTRY_DEV}" ]; then
  registry="${DOCKER_REGISTRY_DEV}"
  image_base="${DOCKER_REGISTRY_DEV}/${IMAGE_NAME}"
else
  echo "DOCKER_REGISTRY_DEV not set for a non release image, exiting."
  exit 1
fi

# Log in to registry
if [ "${registry}" ]; then
  exec docker login -e="${DOCKER_EMAIL}" -u="${DOCKER_USERNAME}" -p="${DOCKER_PASSWORD}" ${registry}
else
  echo "Docker registry failed to set properly, exiting."
  exit 1
fi

# Pull requests (image:commit-branch-pr-prnum)
if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then
  tags+=("${image_base}:${TRAVIS_COMMIT}-${TRAVIS_BRANCH}-pr-${TRAVIS_PULL_REQUEST}")
fi

# If commit tagged in master, tag as version and latest
if [ "${TRAVIS_BRANCH}" = "master" ] && [ "${TRAVIS_TAG}" ]; then
  tags+=("${image_base}:${TRAVIS_TAG}")
  tags+=("${image_base}:latest")
else
  tags+=("${image_base}:${TRAVIS_COMMIT}-${TRAVIS_BRANCH}")
fi

# Tag and push all image tags
for tag in ${tags[@]}; do
  exec docker tag ${IMAGE_NAME}:${TRAVIS_COMMIT} ${tag}
done

# Push images (may add branch criteria in the future)
for tag in ${tags[@]}; do
  exec docker push ${tag}
done
{'fraction_non_alphanumeric': 0.1765129682997118, 'fraction_numerical': 0.001440922190201729, 'mean_word_length': 5.580568720379147, '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': '2086327', 'n_tokens_mistral': 1057, 'n_tokens_neox': 1023, 'n_words': 262}