<commit_before>#!/bin/bash
#
# Some basic automated tests for gruntwork-installer

set -e

readonly LOCAL_INSTALL_URL="file:///src/gruntwork-install"

echo "Using local copy of bootstrap installer to install local copy of gruntwork-install"
./src/bootstrap-gruntwork-installer.sh --download-url "$LOCAL_INSTALL_URL" --version "ignored-for-local-install"

echo "Using gruntwork-install to install a few modules from script-modules"
gruntwork-install --module-name "vault-ssh-helper" --repo "https://github.com/gruntwork-io/script-modules" --tag "~>0.0.21"

echo "Checking that the vault-ssh-helper installed correctly"
/etc/user-data/vault-ssh-helper/download-ca-cert.sh --help

echo "Using gruntwork-install to install a module from the module-ecs repo"
gruntwork-install --module-name "ecs-scripts" --repo "https://github.com/gruntwork-io/module-ecs" --branch "v0.0.1"

echo "Using gruntwork-install to install a module from the module-ecs repo with --download-dir option"
gruntwork-install --module-name "ecs-scripts" --repo "https://github.com/gruntwork-io/module-ecs" --branch "v0.0.1" --download-dir "~/tmp"

echo "Checking that the ecs-scripts installed correctly"
configure-ecs-instance --help

echo "Using gruntwork-install to install a binary from the gruntkms repo"
gruntwork-install --binary-name "gruntkms" --repo "https://github.com/gruntwork-io/gruntkms" --tag "v0.0.1"

echo "Checking that gruntkms installed correctly"
gruntkms --help<commit_msg>Update test to check module-params<commit_after>#!/bin/bash
#
# Some basic automated tests for gruntwork-installer

set -e

readonly LOCAL_INSTALL_URL="file:///src/gruntwork-install"

echo "Using local copy of bootstrap installer to install local copy of gruntwork-install"
./src/bootstrap-gruntwork-installer.sh --download-url "$LOCAL_INSTALL_URL" --version "ignored-for-local-install"

echo "Using gruntwork-install to install a module from the module-ecs repo"
gruntwork-install --module-name "ecs-scripts" --repo "https://github.com/gruntwork-io/module-ecs" --branch "v0.0.1"

echo "Using gruntwork-install to install a module from the module-ecs repo with --download-dir option"
gruntwork-install --module-name "ecs-scripts" --repo "https://github.com/gruntwork-io/module-ecs" --branch "v0.0.1" --download-dir "~/tmp"

echo "Checking that the ecs-scripts installed correctly"
configure-ecs-instance --help

echo "Using gruntwork-install to install a module from the gruntwork-install repo and passing args to it via --module-param"
gruntwork-install --module-name "dummy-module" --repo "https://github.com/gruntwork-io/gruntwork-installer" --branch "fix-args" --module-param "file-to-cat=README.md"

echo "Using gruntwork-install to install a binary from the gruntkms repo"
gruntwork-install --binary-name "gruntkms" --repo "https://github.com/gruntwork-io/gruntkms" --tag "v0.0.1"

echo "Checking that gruntkms installed correctly"
gruntkms --help
{'fraction_non_alphanumeric': 0.1313893653516295, 'fraction_numerical': 0.007547169811320755, 'mean_word_length': 4.370165745856354, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 7, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1326627', 'n_tokens_mistral': 978, 'n_tokens_neox': 956, 'n_words': 266}