<commit_before>#!/bin/bash

echo "***********************************************************************"
echo "****************** Configuring and Error Checking *********************"
echo "***********************************************************************"

BASENAME="Library"
echo "Image base name set to $BASENAME"

if [ ! -z "$IMAGE_BASE_NAME" ]; then
	BASENAME="$IMAGE_BASE_NAME"
	echo "Image base name changed to $IMAGE_BASE_NAME"
fi

PROJECTTITLE=${PROJECT_TITLE}
echo "Project title set to $PROJECTTITLE"

if [ ! -z "$DOCKER_PROJECT_TITLE" ]; then
	PROJECTTITLE="$DOCKER_PROJECT_TITLE"
	echo "Project title changed to $PROJECTTITLE"
fi

DOCKER_REPO_SECURITY="private"

if [ "$DOCKER_REPO_TYPE" == "public" ]; then
	DOCKER_REPO_SECURITY="public"
fi

echo "Checking for /var/run/docker.sock..."

if [ ! -e /var/run/docker.sock ]; then
	echo "*** ERROR! Could not find /var/run/docker.sock"
	exit -1
fi

echo "Found."

echo "Checking for /bin/docker..."

if [ ! -e /bin/docker ]; then
        echo "*** ERROR! Could not find /bin/docker"
        exit -1
fi

echo "Found."

echo "Checking for /home/user/.dockercfg..."

if [ ! -e /home/user/.dockercfg ]; then
        echo "*** ERROR! Could not find /home/user/.dockercfg"
        exit -1
fi

echo "Found."

echo "Building image..."
echo "Moving into app folder.."
cd ./$PROJECTTITLE
cd ./app
echo "Starting docker build at $(date +%H:%M:%S)"
docker build -t $BASENAME/$PROJECTTITLE:${PROJECT_BRANCH}-${BUILD_NUMBER} .
CMDRET=$?

echo "Docker build complete at $(date +%H:%M:%S)"

if [ $CMDRET -ne 0 ]; then
	echo "*** ERROR! Image build failed with error code $CMDRET"
	exit -1
fi
<commit_msg>Introduce DOCKER_BUILD_DIR.<commit_after>#!/bin/bash

echo "***********************************************************************"
echo "****************** Configuring and Error Checking *********************"
echo "***********************************************************************"

BASENAME="Library"
echo "Image base name set to $BASENAME"

if [ ! -z "$IMAGE_BASE_NAME" ]; then
	BASENAME="$IMAGE_BASE_NAME"
	echo "Image base name changed to $IMAGE_BASE_NAME"
fi

PROJECTTITLE=${PROJECT_TITLE}
echo "Project title set to $PROJECTTITLE"

if [ ! -z "$DOCKER_PROJECT_TITLE" ]; then
    PROJECTTITLE="$DOCKER_PROJECT_TITLE"
    echo "Project title changed to $PROJECTTITLE"
fi

BUILD_DIR="./$PROJECTTITLE"
echo "Docker build directory set to $BUILD_DIR"

if [ ! -z "$DOCKER_BUILD_DIR" ]; then
    BUILD_DIR="./$DOCKER_BUILD_DIR"
    echo "Docker build directory changed to $BUILD_DIR"
fi


DOCKER_REPO_SECURITY="private"

if [ "$DOCKER_REPO_TYPE" == "public" ]; then
	DOCKER_REPO_SECURITY="public"
fi

echo "Checking for /var/run/docker.sock..."

if [ ! -e /var/run/docker.sock ]; then
	echo "*** ERROR! Could not find /var/run/docker.sock"
	exit -1
fi

echo "Found."

echo "Checking for /bin/docker..."

if [ ! -e /bin/docker ]; then
        echo "*** ERROR! Could not find /bin/docker"
        exit -1
fi

echo "Found."

echo "Checking for /home/user/.dockercfg..."

if [ ! -e /home/user/.dockercfg ]; then
        echo "*** ERROR! Could not find /home/user/.dockercfg"
        exit -1
fi

echo "Found."

echo "Building image..."
echo "Moving into app folder.."
cd "$BUILD_DIR"
echo "Starting docker build at $(date +%H:%M:%S)"
docker build -t $BASENAME/$PROJECTTITLE:${PROJECT_BRANCH}-${BUILD_NUMBER} .
CMDRET=$?

echo "Docker build complete at $(date +%H:%M:%S)"

if [ $CMDRET -ne 0 ]; then
	echo "*** ERROR! Image build failed with error code $CMDRET"
	exit -1
fi

{'fraction_non_alphanumeric': 0.23824362606232294, 'fraction_numerical': 0.0028328611898017, 'mean_word_length': 4.231111111111111, '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': '1427887', 'n_tokens_mistral': 1271, 'n_tokens_neox': 1190, 'n_words': 340}