<commit_before>#!/bin/sh

set -ex

main() {
  cleanup
  setTags

  buildImage
  testImage

  docker kill `docker ps -q --filter "image=local/$SERVICE_NAME:$TAG"`
  docker run -p 9494:9494 -d $DOCKER_HUB_ACCOUNT/$SERVICE_NAME:$TAG
  docker ps
  echo "Docker host: ${DOCKER_HOST}"
}

cleanup() {
  \rm -f report.xml || true
}
buildImage() {
  docker build --pull=true --tag ${DOCKER_HUB_ACCOUNT}/${SERVICE_NAME}:${TAG} .
}

testImage() {
  docker run -i -P $DOCKER_HUB_ACCOUNT/$SERVICE_NAME:$TAG ./test.sh > report.xml

  CIDFILE=.cidfile.tmp
  \rm "${CIDFILE}" || true
  docker run -P -d --cidfile="${CIDFILE}" $DOCKER_HUB_ACCOUNT/$SERVICE_NAME:$TAG

  trap 'docker rm -f $(cat "${CIDFILE}"); rm -f "${CIDFILE}";' EXIT

  docker logs -f $(cat "${CIDFILE}") &

}

setTags() {
  SERVICE_NAME="$(basename "$(pwd)")"
  DEV_TAG="dev-latest"
  TAG="latest"
  DOCKER_HUB_ACCOUNT="local"
  echo "${TAG} development environment configuration..."
}

main
<commit_msg>Priya: Prevent starting up containers after build<commit_after>#!/bin/sh

set -ex

main() {
  cleanup
  setTags

  buildImage
  testImage
}

cleanup() {
  \rm -f report.xml || true
}
buildImage() {
  docker build --pull=true --tag ${DOCKER_HUB_ACCOUNT}/${SERVICE_NAME}:${TAG} .
}

testImage() {
  docker run -i -P $DOCKER_HUB_ACCOUNT/$SERVICE_NAME:$TAG ./test.sh > report.xml

  CIDFILE=.cidfile.tmp
  \rm "${CIDFILE}" || true
  docker run -P -d --cidfile="${CIDFILE}" $DOCKER_HUB_ACCOUNT/$SERVICE_NAME:$TAG

  trap 'docker rm -f $(cat "${CIDFILE}"); rm -f "${CIDFILE}";' EXIT

  docker logs -f $(cat "${CIDFILE}") &

}

setTags() {
  SERVICE_NAME="$(basename "$(pwd)")"
  DEV_TAG="dev-latest"
  TAG="latest"
  DOCKER_HUB_ACCOUNT="local"
  echo "${TAG} development environment configuration..."
}

main

{'fraction_non_alphanumeric': 0.18135304150085277, 'fraction_numerical': 0.0045480386583285955, 'mean_word_length': 3.916201117318436, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '6995152', 'n_tokens_mistral': 723, 'n_tokens_neox': 691, 'n_words': 153}