<commit_before>#!/bin/bash -e

SUDO=""

function print_plugins_params() {

    echo "## print common parameters"

    declare -A params=( ["PLUGIN_NAME"]=$PLUGIN_NAME ["PLUGIN_TAG_NAME"]=$PLUGIN_TAG_NAME  \
                        ["PLUGIN_S3_FOLDER"]=$PLUGIN_S3_FOLDER )
    for param in "${!params[@]}"
    do
            echo "$param - ${params["$param"]}"
    done
}

function install_dependencies(){
    echo "## Installing necessary dependencies"

    if  which yum; then
        sudo yum -y install python-devel gcc openssl git libxslt-devel libxml2-devel openldap-devel
    elif which apt-get; then
        sudo apt-get update &&
        sudo apt-get -y install build-essential python-dev
    else
        echo 'probably windows machine'
        pip install virtualenv
        return
    fi
    curl --silent --show-error --retry 5 https://bootstrap.pypa.io/get-pip.py | sudo python &&
    sudo pip install pip==7.1.2 --upgrade
    sudo pip install virtualenv
}

function install_wagon(){
    echo "## installing wagon"
    virtualenv env
    source env/bin/activate
    if  which yum; then
        echo 'redaht/centos machine'
    elif which apt-get; then
        echo 'ubuntu/debian machine'
    else
        echo 'probably windows machine'
        pip install wagon==0.3.0
        return
    fi
    pip install wagon==0.3.1
}

function wagon_create_package(){

    echo "## wagon create package"
    if [[ "$PLUGIN_NAME" =~ "vsphere" ]] || [[ "$PLUGIN_NAME" =~ "softlayer" ]]; then
        git clone https://$GITHUB_USERNAME:$GITHUB_PASSWORD@github.com/cloudify-cosmo/$PLUGIN_NAME.git
        pushd $PLUGIN_TAG_NAME
            git checkout -b $PLUGIN_TAG_NAME origin/$PLUGIN_TAG_NAME
        popd
        mkdir create_wagon ; cd create_wagon
        wagon create -s ../$PLUGIN_NAME/<commit_msg>CFY-5450 update wagon to 0.3.2<commit_after>#!/bin/bash -e

SUDO=""

function print_plugins_params() {

    echo "## print common parameters"

    declare -A params=( ["PLUGIN_NAME"]=$PLUGIN_NAME ["PLUGIN_TAG_NAME"]=$PLUGIN_TAG_NAME  \
                        ["PLUGIN_S3_FOLDER"]=$PLUGIN_S3_FOLDER )
    for param in "${!params[@]}"
    do
            echo "$param - ${params["$param"]}"
    done
}

function install_dependencies(){
    echo "## Installing necessary dependencies"

    if  which yum; then
        sudo yum -y install python-devel gcc openssl git libxslt-devel libxml2-devel openldap-devel
    elif which apt-get; then
        sudo apt-get update &&
        sudo apt-get -y install build-essential python-dev
    else
        echo 'probably windows machine'
        pip install virtualenv
        return
    fi
    curl --silent --show-error --retry 5 https://bootstrap.pypa.io/get-pip.py | sudo python &&
    sudo pip install pip==7.1.2 --upgrade
    sudo pip install virtualenv
}

function install_wagon(){
    echo "## installing wagon"
    virtualenv env
    source env/bin/activate
    if  which yum; then
        echo 'redaht/centos machine'
    elif which apt-get; then
        echo 'ubuntu/debian machine'
    else
        echo 'probably windows machine'
    fi
    pip install wagon==0.3.2
}

function wagon_create_package(){

    echo "## wagon create package"
    if [[ "$PLUGIN_NAME" =~ "vsphere" ]] || [[ "$PLUGIN_NAME" =~ "softlayer" ]]; then
        git clone https://$GITHUB_USERNAME:$GITHUB_PASSWORD@github.com/cloudify-cosmo/$PLUGIN_NAME.git
        pushd $PLUGIN_TAG_NAME
            git checkout -b $PLUGIN_TAG_NAME origin/$PLUGIN_TAG_NAME
        popd
        mkdir create_wagon ; cd create_wagon
        wagon create -s ../$PLUGIN_NAME/
{'fraction_non_alphanumeric': 0.11030438425020944, 'fraction_numerical': 0.008377548170901982, 'mean_word_length': 2.5535714285714284, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 2, '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': '2812442', 'n_tokens_mistral': 1210, 'n_tokens_neox': 1142, 'n_words': 303}