<commit_before>#!/usr/bin/env bash

# A simple wrapper to run ansible from Jenkins.
# This assumes that you will be running on one or more servers
# that are tagged with Name: <environment>-<deployment>-<play>

if [[
        -z $WORKSPACE           ||
        -z $environment_tag     ||
        -z $deployment_tag      ||
        -z $play_tag            ||
        -z $ansible_play        ||
        -z $elb_pre_post        ||
        -z $first_in            ||
        -z $serial_count
    ]]; then
    echo "Environment incorrect for this wrapper script"
    env
    exit 1
fi

cd $WORKSPACE/configuration/playbooks/edx-east

ansible_extra_vars+=" -e serial_count=$serial_count -e elb_pre_post=$elb_pre_post"

if [ ! -z "$extra_vars" ]; then
      ansible_extra_vars+=" -e $extra_vars"
fi

if [[ $run_migrations == "true" ]]; then
      ansible_extra_vars+=" -e migrate_db=yes"
fi

if [[ $first_in == "true" ]]; then
    ansible_limit+="first_in_"
fi
ansible_limit+="tag_Name_${environment_tag}-${deployment_tag}-${play_tag}"

ansible_task_tags=""

if [[ -z "$task_tags" ]]; then
    ansible_task_tags+="--tags $task_tags"
fi

export PYTHONUNBUFFERED=1
env
ansible-playbook -v -u ubuntu $ansible_play -i ./ec2.py $ansible_task_tags --limit $ansible_limit -e@"$WORKSPACE/configuration-secure/ansible/vars/${deployment_tag}.yml" -e@"$WORKSPACE/configuration-secure/ansible/vars/${environment_tag}-${deployment_tag}.yml" $ansible_extra_vars <commit_msg>only add tags if task_tags is not null<commit_after>#!/usr/bin/env bash

# A simple wrapper to run ansible from Jenkins.
# This assumes that you will be running on one or more servers
# that are tagged with Name: <environment>-<deployment>-<play>

if [[
        -z $WORKSPACE           ||
        -z $environment_tag     ||
        -z $deployment_tag      ||
        -z $play_tag            ||
        -z $ansible_play        ||
        -z $elb_pre_post        ||
        -z $first_in            ||
        -z $serial_count
    ]]; then
    echo "Environment incorrect for this wrapper script"
    env
    exit 1
fi

cd $WORKSPACE/configuration/playbooks/edx-east

ansible_extra_vars+=" -e serial_count=$serial_count -e elb_pre_post=$elb_pre_post"

if [ ! -z "$extra_vars" ]; then
      ansible_extra_vars+=" -e $extra_vars"
fi

if [[ $run_migrations == "true" ]]; then
      ansible_extra_vars+=" -e migrate_db=yes"
fi

if [[ $first_in == "true" ]]; then
    ansible_limit+="first_in_"
fi
ansible_limit+="tag_Name_${environment_tag}-${deployment_tag}-${play_tag}"

ansible_task_tags=""

if [[ ! -z "$task_tags" ]]; then
    ansible_task_tags+="--tags $task_tags"
fi

export PYTHONUNBUFFERED=1
env
ansible-playbook -v -u ubuntu $ansible_play -i ./ec2.py $ansible_task_tags --limit $ansible_limit -e@"$WORKSPACE/configuration-secure/ansible/vars/${deployment_tag}.yml" -e@"$WORKSPACE/configuration-secure/ansible/vars/${environment_tag}-${deployment_tag}.yml" $ansible_extra_vars 
{'fraction_non_alphanumeric': 0.13476629136813376, 'fraction_numerical': 0.0020470829068577278, 'mean_word_length': 3.1237693389592125, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '3192612', 'n_tokens_mistral': 1040, 'n_tokens_neox': 1021, 'n_words': 229}