<commit_before>#!/bin/bash -e
declare -A dockerfiles
dockerfiles=(["heywill/will-base:2.7-alpine$BTAG"]="/will-base/base-2.7/"
    ["heywill/will-base:3.7-alpine$BTAG"]="/will-base/base-3.x/"
    ["heywill/will:python2.7$BTAG"]="/will/will-py2/"
    ["heywill/will:python3.7$BTAG"]="/will/will-py3/")

build_containers() {

    for tag in "${!dockerfiles[@]}"; 
        do 
            echo "building $tag with context ${dockerfiles[$tag]}";
            docker build -t $tag $(dirname $(readlink -f ${BASH_SOURCE[0]}))${dockerfiles[$tag]};
            echo ""
        done;
}

tag_latest(){

    docker tag heywill/will-base:3.7-alpine heywill/will-base:latest
    echo "tagged heywill/will-base:3.7-alpine as heywill/will-base:latest"
    docker tag heywill/will:python3.7 heywill/will:latest
    echo "tagged heywill/will:3.7 as heywill/will:latest"
}


push_containers(){
    tag_latest
    for tag in "${!dockerfiles[@]}"; 
        do 
            echo "pushing $tag";
            docker push $tag;
            echo ""
        done;
    
   docker push heywill/will-base:latest
   docker push heywill/will:latest
}
echo "Building with BTAG: $BTAG"
case $1 in 
    "--all")
        build_containers
        push_containers
        ;;
    
    "--build")
        build_containers
        ;;
    
    "--push")
        push_containers
        ;;

    *)
        echo "You did something wrong"
        exit 1
        ;;
esac
<commit_msg>build script will build locally from a remote branch tags and pushes production branches<commit_after>#!/bin/bash -e

declare -A dockerfiles
dockerfiles=(
    ["heywill/will:python2.7$GTAG"]="/will/will-py2/"
    ["heywill/will:python3.7$GTAG"]="/will/will-py3/")

build_containers() {

    for tag in "${!dockerfiles[@]}"; 
        do 
            echo "building $tag with context ${dockerfiles[$tag]}";
            docker build -t $tag $(dirname $(readlink -f ${BASH_SOURCE[0]}))${dockerfiles[$tag]};
            echo ""
        done;
}

tag_production(){
    docker tag heywill/will:python2.7$GTAG heywill/will:python2.7
    echo "tagged heywill/will:python2.7$GTAG as heywill/will:latest"
    
    docker tag heywill/will:python3.7$GTAG heywill/will:python3.7
    docker tag heywill/will:python3.7$GTAG heywill/will:latest
    echo "tagged heywill/will:python3.7$GTAG as heywill/will:latest & heywill/will:python3.7"
}


push_containers(){
   tag_latest
   docker push heywill/will-base:latest
   docker push heywill/will:latest
}
echo "Building with BTAG: $BTAG"
case $1 in 
    "--all")
        build_containers
        push_containers
        ;;
    
    "--build")
        build_containers
        ;;
    
    "--push")
        push_containers
        ;;

    *)
        echo "You did something wrong"
        exit 1
        ;;
esac

{'fraction_non_alphanumeric': 0.14290856731461482, 'fraction_numerical': 0.017638588912886968, 'mean_word_length': 2.4182041820418205, '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': '2986885', 'n_tokens_mistral': 994, 'n_tokens_neox': 925, 'n_words': 192}