<commit_before>#!/bin/bash

#
# This script is only intended to run in the IBM DevOps Services Pipeline Environment.
#

#!/bin/bash
echo Informing Slack...
curl -X 'POST' --silent --data-binary '{"text":"A new build for the mediator service has started."}' $WEBHOOK > /dev/null

echo Setting up Docker...
mkdir dockercfg ; cd dockercfg
echo -e $KEY > key.pem
echo -e $CA_CERT > ca.pem
echo -e $CERT > cert.pem
echo Key `echo $KEY | md5sum`
echo Ca Cert `echo $CA_CERT | md5sum`
echo Cert `echo $CERT | md5sum`
cd ..

echo Obtaining docker.
wget http://security.ubuntu.com/ubuntu/pool/main/a/apparmor/libapparmor1_2.8.95~2430-0ubuntu5.3_amd64.deb -O libapparmor.deb
sudo dpkg -i libapparmor.deb
rm libapparmor.deb
wget https://get.docker.com/builds/Linux/x86_64/docker-1.9.1 --quiet -O docker
chmod +x docker

echo Building projects using gradle...
./gradlew build
if [ $? != 0 ]
then
  echo Gradle Build failed.
  exit -1
else
  cd mediator-wlpcfg
  ../docker build -t gameon-mediator -f Dockerfile.live .
  if [ $? != 0 ]
  then
    echo Docker Build failed.
    exit -2
  else
    echo Attempting to remove old containers.
    ../docker stop -t 0 gameon-mediator || true
    ../docker rm gameon-mediator || true
    echo Starting new container.
    ../docker run -d -p 9086:9080 -p 9446:9443 --link etcd -e LICENSE=accept -e ETCDCTL_ENDPOINT=http://etcd:4001 --name=gameon-mediator gameon-mediator
    if [ $? != 0 ]
    then
      echo Docker Run failed.
      exit -3
    else
      cd ..
      rm -rf dockercfg
    fi
  fi
fi<commit_msg>Add restart flag<commit_after>#!/bin/bash

#
# This script is only intended to run in the IBM DevOps Services Pipeline Environment.
#

#!/bin/bash
echo Informing Slack...
curl -X 'POST' --silent --data-binary '{"text":"A new build for the mediator service has started."}' $WEBHOOK > /dev/null

echo Setting up Docker...
mkdir dockercfg ; cd dockercfg
echo -e $KEY > key.pem
echo -e $CA_CERT > ca.pem
echo -e $CERT > cert.pem
echo Key `echo $KEY | md5sum`
echo Ca Cert `echo $CA_CERT | md5sum`
echo Cert `echo $CERT | md5sum`
cd ..

echo Obtaining docker.
wget http://security.ubuntu.com/ubuntu/pool/main/a/apparmor/libapparmor1_2.8.95~2430-0ubuntu5.3_amd64.deb -O libapparmor.deb
sudo dpkg -i libapparmor.deb
rm libapparmor.deb
wget https://get.docker.com/builds/Linux/x86_64/docker-1.9.1 --quiet -O docker
chmod +x docker

echo Building projects using gradle...
./gradlew build
if [ $? != 0 ]
then
  echo Gradle Build failed.
  exit -1
else
  cd mediator-wlpcfg
  ../docker build -t gameon-mediator -f Dockerfile.live .
  if [ $? != 0 ]
  then
    echo Docker Build failed.
    exit -2
  else
    echo Attempting to remove old containers.
    ../docker stop -t 0 gameon-mediator || true
    ../docker rm gameon-mediator || true
    echo Starting new container.
    ../docker run -d -p 9086:9080 -p 9446:9443 --restart=always --link etcd -e LICENSE=accept -e ETCDCTL_ENDPOINT=http://etcd:4001 --name=gameon-mediator gameon-mediator
    if [ $? != 0 ]
    then
      echo Docker Run failed.
      exit -3
    else
      cd ..
      rm -rf dockercfg
    fi
  fi
fi
{'fraction_non_alphanumeric': 0.12210051546391752, 'fraction_numerical': 0.03286082474226804, 'mean_word_length': 2.7682038834951457, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 2, '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': '2036002', 'n_tokens_mistral': 1232, 'n_tokens_neox': 1113, 'n_words': 362}