<commit_before>#!/bin/sh

###############################################################
# This script will build the core version of the EAP instance,
# storing the image to jlgrock/jboss-eap.  If you drop extra WARs
# into the install directory, you can create a custom deployment.
# It is suggested that you don't use this script though, as you'll
# want to store this image to something other than jlgrock/jboss-eap.
# For example, you can put webapp.war in there and create an instance
# called my/webapp.
###############################################################

# load the versions
. ./loadenv.sh

FROM_IMAGE_NAME=jlgrock/centos-oraclejdk
FROM_IMAGE_VERSION=6.6-8u45
IMAGE_NAME=jlgrock/jboss-eap
IMAGE_VERSION=$JBOSS_EAP
TMP_IMAGE_NAME="${IMAGE_NAME}-temp"

echo "Processing for JBOSS EAP Version $JBOSS_EAP"

if [ ! -e install_files/jboss-eap-$JBOSS_EAP.zip ]; then
	echo "could not find file install_files/jboss-eap-$JBOSS_EAP.zip"
	echo "You should put the required JBoss EAP binary into the root directory first."
	exit 255
fi

if [ ! -e install_files/activemq-rar*.rar ]; then
	echo "could not find file install_files/jboss-activemq-rar*.rar"
	echo "You should put the required JBoss A-MQ connector in the root directory first."
	exit 255
fi

# pull latest from repo
docker pull ${FROM_IMAGE_NAME}:${FROM_IMAGE_VERSION}

# Create a temporary image
echo "Creating JBoss EAP Image ..."
docker build -q --rm -t ${TMP_IMAGE_NAME}:${IMAGE_VERSION} .

# Start Image and get ID
ID=$(docker run -d ${TMP_IMAGE_NAME}:${IMAGE_VERSION} /bin/bash)
echo "Container ID '$ID' now running"

# Flatten the image (removes AUFS layers) and create a new image
docker export ${ID} | docker import - ${IMAGE_NAME}
echo "destroying images/containers related to $TMP_IMAGE_NAME (all versions)"
docker ps -a | awk '{ print $1,$2 }' | grep ${TMP_IMAGE_NAME} | awk '{ print $1 }' | xargs -I {} docker rm {}
docker images -a | awk '{ print $1, $3 }' | grep ${TMP_IMAGE_NAME} | awk '{ print $2 }' | xargs -I {} docker rmi {}

if [ $? -eq 0 ]; then
    echo "Container Built"
else
    echo "Error: Unable to Build Container"
fi
<commit_msg>left off version tag to import<commit_after>#!/bin/sh

###############################################################
# This script will build the core version of the EAP instance,
# storing the image to jlgrock/jboss-eap.  If you drop extra WARs
# into the install directory, you can create a custom deployment.
# It is suggested that you don't use this script though, as you'll
# want to store this image to something other than jlgrock/jboss-eap.
# For example, you can put webapp.war in there and create an instance
# called my/webapp.
###############################################################

# load the versions
. ./loadenv.sh

FROM_IMAGE_NAME=jlgrock/centos-oraclejdk
FROM_IMAGE_VERSION=6.6-8u45
IMAGE_NAME=jlgrock/jboss-eap
IMAGE_VERSION=$JBOSS_EAP
TMP_IMAGE_NAME="${IMAGE_NAME}-temp"

echo "Processing for JBOSS EAP Version $JBOSS_EAP"

if [ ! -e install_files/jboss-eap-$JBOSS_EAP.zip ]; then
	echo "could not find file install_files/jboss-eap-$JBOSS_EAP.zip"
	echo "You should put the required JBoss EAP binary into the root directory first."
	exit 255
fi

if [ ! -e install_files/activemq-rar*.rar ]; then
	echo "could not find file install_files/jboss-activemq-rar*.rar"
	echo "You should put the required JBoss A-MQ connector in the root directory first."
	exit 255
fi

# pull latest from repo
docker pull ${FROM_IMAGE_NAME}:${FROM_IMAGE_VERSION}

# Create a temporary image
echo "Creating JBoss EAP Image ..."
docker build -q --rm -t ${TMP_IMAGE_NAME}:${IMAGE_VERSION} .

# Start Image and get ID
ID=$(docker run -d ${TMP_IMAGE_NAME}:${IMAGE_VERSION} /bin/bash)
echo "Container ID '$ID' now running"

# Flatten the image (removes AUFS layers) and create a new image
docker export ${ID} | docker import - ${IMAGE_NAME}:${IMAGE_VERSION}
echo "destroying images/containers related to $TMP_IMAGE_NAME (all versions)"
docker ps -a | awk '{ print $1,$2 }' | grep ${TMP_IMAGE_NAME} | awk '{ print $1 }' | xargs -I {} docker rm {}
docker images -a | awk '{ print $1, $3 }' | grep ${TMP_IMAGE_NAME} | awk '{ print $2 }' | xargs -I {} docker rmi {}

if [ $? -eq 0 ]; then
    echo "Container Built"
else
    echo "Error: Unable to Build Container"
fi

{'fraction_non_alphanumeric': 0.16208663251047975, 'fraction_numerical': 0.008383791336748951, 'mean_word_length': 4.577922077922078, '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': '3149289', 'n_tokens_mistral': 1439, 'n_tokens_neox': 1368, 'n_words': 499}