<commit_before>#!/usr/bin/env bash
echo "--> Building..."
#Make sure $GOPATH is set
CGO_ENABLED=0 go install github.com/Tecsisa/foulkon/cmd/worker
CGO_ENABLED=0 go install github.com/Tecsisa/foulkon/cmd/proxy

mkdir bin/ 2>/dev/null
cp $GOPATH/bin/worker ./bin
cp $GOPATH/bin/proxy ./bin

echo "----> Building Docker images..."
docker build -t tecsisa/foulkon:latest -f scripts/docker/Dockerfile .

echo "----> Pushing images to Docker hub"
docker login -u ${DOCKER_HUB_USER} -p ${DOCKER_HUB_KEY}
docker push tecsisa/foulkon:latest
<commit_msg>build only tagged commit or master branch<commit_after>#!/usr/bin/env bash

branch=$(git rev-parse --abbrev-ref HEAD)
tag=$(git tag --points-at HEAD)

if [ "$tag" != "" ]; then
    build=$tag
elif [ "$branch" == "master" ]; then
    build="latest"
else
    echo "Not in <master> branch or <tagged> commit, exiting..."
    exit 0
fi

echo "--> Building..."
#Make sure $GOPATH is set
CGO_ENABLED=0 go install github.com/Tecsisa/foulkon/cmd/worker
CGO_ENABLED=0 go install github.com/Tecsisa/foulkon/cmd/proxy

mkdir bin/ 2>/dev/null
cp $GOPATH/bin/worker ./bin
cp $GOPATH/bin/proxy ./bin

echo "----> Building Docker images..."
docker build -t tecsisa/foulkon:$build -f scripts/docker/Dockerfile .

echo "----> Pushing images to Docker hub"
docker login -u ${DOCKER_HUB_USER} -p ${DOCKER_HUB_KEY}
docker push tecsisa/foulkon:$build

{'fraction_non_alphanumeric': 0.15138282387190685, 'fraction_numerical': 0.005094614264919942, 'mean_word_length': 3.7909407665505226, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '1019673', 'n_tokens_mistral': 533, 'n_tokens_neox': 511, 'n_words': 138}