<commit_before>#!/bin/bash

declare -a repos=("openfaas-incubator/faas-idler" "openfaas/faas" "openfaas/faas-swarm" "openfaas/nats-queue-worker" "openfaas/faas-netes" "openfaas/faas-cli")

HERE=`pwd`

#if [ ! -z "$CACHED" ]; then
    rm -rf staging || :
    mkdir -p staging/openfaas
    mkdir -p staging/openfaas-incubator

#fi

for i in "${repos[@]}"
do
   cd $HERE

   echo "$i"
   git clone https://github.com/$i ./staging/$i
   cd ./staging/$i
   pwd
   export TAG=$(git describe --abbrev=0 --tags)
   echo "Latest release: $TAG"

   make ci-armhf-build ci-armhf-push

done
<commit_msg>Check if the Docker image is already present.<commit_after>#!/bin/bash

declare -a repos=("openfaas-incubator/faas-idler" "openfaas/faas" "openfaas/faas-swarm" "openfaas/nats-queue-worker" "openfaas/faas-netes" "openfaas/faas-cli")

HERE=`pwd`

#if [ ! -z "$CACHED" ]; then
    rm -rf staging || :
    mkdir -p staging/openfaas
    mkdir -p staging/openfaas-incubator

#fi

get_repo_name() {
    if  [ "openfaas-incubator/faas-idler" = $1 ]; then
        echo "openfaas/faas-idler"
    elif  [ "openfaas/faas" = $1 ]; then
        echo "openfaas/gateway"
    elif  [ "openfaas/nats-queue-worker" = $1 ]; then
        echo "openfaas/queue-worker"
    else
        echo $1
    fi
}

for i in "${repos[@]}"
do
   cd $HERE

   echo -e "\nBuilding: $i\n"
   git clone https://github.com/$i ./staging/$i
   cd ./staging/$i
   pwd
   export TAG=$(git describe --abbrev=0 --tags)
   echo "Latest release: $TAG"

   REPOSITORY=$(get_repo_name $i)
   TAG_PRESENT=$(curl -s "https://hub.docker.com/v2/repositories/${REPOSITORY}/tags/${TAG}-armhf/" | jq -r ".detail")

   if [ "$TAG_PRESENT" = "Not found" ]; then
       make ci-armhf-build ci-armhf-push
   else
       echo "Image is already present: ${REPOSITORY}:${TAG}-armhf"
   fi
done

{'fraction_non_alphanumeric': 0.16813186813186815, 'fraction_numerical': 0.0038461538461538464, 'mean_word_length': 2.891025641025641, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 3, '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': '4704950', 'n_tokens_mistral': 762, 'n_tokens_neox': 730, 'n_words': 159}