<commit_before>#!/bin/bash

REPO=$1
BRANCH=$2
COMMIT=$3
TMP="${TMPDIR}./deploy2/${REPO}"

if [ ! -d "${TMP}/.git" ] ; then
    mkdir -p $TMP
    git clone --depth=100 --branch=$BRANCH "<EMAIL>:${REPO}.git" $TMP
fi

cd $TMP

git fetch origin
git checkout -qf $COMMIT

cap staging deploy --set branch=$BRANCH<commit_msg>Clean up deploy.sh<commit_after>#!/bin/bash

# Help screen
if [ -z "$1" -o -z "$2" -o -z "$3" ] ; then
    echo "Usage: deploy.sh Username/Repo master COMMITTISH"
    exit 1
fi

# Force develop/master
if [ ! \( "develop" = "$2" -o "master" = "$2" \) ] ; then
    echo "$2 is not a deployable branch."
    exit 1
fi

# Setup repository for deployment
setup ()
{
    local TMP="${TMPDIR}/tmp/deploy2/$1"

    if [ ! -d "${TMP}/.git" ] ; then
        mkdir -p $TMP
        git clone --depth=100 --branch=$2 "<EMAIL>:$1.git" $TMP
    fi

    cd $TMP

    git fetch origin
    git checkout -qf $3
}

# Custom deployment script
deploy ()
{
    cap staging deploy --set branch=$2
}

setup $@ && deploy $@

exit $?
{'fraction_non_alphanumeric': 0.1806640625, 'fraction_numerical': 0.0234375, 'mean_word_length': 2.673835125448029, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '3569374', 'n_tokens_mistral': 406, 'n_tokens_neox': 393, 'n_words': 117}