<commit_before>#!/bin/bash

set -e

# Optionally use the first parameter to specify the component to deploy
# If not specified all components are deployed
COMPONENT=`echo "$1" | tr '[:upper:]' '[:lower:]'`

COMPONENTS=(
"Stepup-Gateway"
"Stepup-Middleware"
"Stepup-SelfService"
"Stepup-RA"
"Stepup-tiqr"
"oath-service-php"
"stepup-demo-gssp"
"stepup-demo-gssp-2"
)

for comp in "${COMPONENTS[@]}"; do
    comp_lower=`echo "${comp}" | tr '[:upper:]' '[:lower:]'`
    if [  -z "${COMPONENT}" -o \( "${COMPONENT}" == "${comp_lower}" \) ]; then
        echo "***** Deploying ${comp_lower} *****"
        echo ansible-playbook deploy/deploy.yml -l app* -i environment/inventory -t ${comp_lower} -e tarball_location="dummy" -e component_dir_name="/src/${comp}" -e develop=true
        ansible-playbook deploy/deploy.yml -l app* -i environment/inventory -t ${comp_lower} -e tarball_location="dummy" -e component_dir_name="/src/${comp}" -e develop=true
    fi
done<commit_msg>Display hint when deploy fails<commit_after>#!/bin/bash

# Optionally use the first parameter to specify the component to deploy
# If not specified all components are deployed
COMPONENT=`echo "$1" | tr '[:upper:]' '[:lower:]'`

COMPONENTS=(
"Stepup-Gateway"
"Stepup-Middleware"
"Stepup-SelfService"
"Stepup-RA"
"Stepup-tiqr"
"oath-service-php"
"stepup-demo-gssp"
"stepup-demo-gssp-2"
)

rv=0
for comp in "${COMPONENTS[@]}"; do
    comp_lower=`echo "${comp}" | tr '[:upper:]' '[:lower:]'`
    if [  -z "${COMPONENT}" -o \( "${COMPONENT}" == "${comp_lower}" \) ]; then
        if [ $rv -ne 0 ]; then
           echo "Skipping deploy of ${comp_lower} due to previous error(s). Use '$0 ${comp_lower}' to deploy this component"
           continue
        fi
        echo "***** Deploying ${comp_lower} *****"
        echo ansible-playbook deploy/deploy.yml -l app* -i environment/inventory -t ${comp_lower} -e tarball_location="dummy" -e component_dir_name="/src/${comp}" -e develop=true
        ansible-playbook deploy/deploy.yml -l app* -i environment/inventory -t ${comp_lower} -e tarball_location="dummy" -e component_dir_name="/src/${comp}" -e develop=true
        rv=$?
        if [ $rv -ne 0 ]; then
            echo ""
            echo "Installation of ${comp_lower} failed"
            echo ""
            echo "Troublesooting tips:"
            echo ""
            echo "- Note that you can deploy individual components. E.g. '$0 ${comp_lower}'"
            echo "- Repeating the installation of a component typically results in configuration errors."
            echo "  reset the component first e.g. 'git reset --hard' (note you will loose all changes!)"
            echo "- The NFS mount can cause intermittent errors during composer install. In that case retry. A git reset"
            echo "  should not be necessary in that case"
            echo "- The error in the ansible output can be hard to read. Repeat the command from the VM for clean output:"
            echo "  - vagrant ssh"
            echo "  - cd /vagrant/src/<component>"
            echo "  - ..."
            echo ""
        fi
    fi
done

exit $rv
{'fraction_non_alphanumeric': 0.1503225806451613, 'fraction_numerical': 0.002903225806451613, 'mean_word_length': 2.8957286432160805, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '2800583', 'n_tokens_mistral': 1007, 'n_tokens_neox': 973, 'n_words': 310}